Worldwide Earthquakes
Earthquake is a simple tool for getting earthquake data. It returns the earthquake data for the past hour.
This API provides reliable and fast access to worldwide earthquakes data through a simple REST interface. Built for developers who need consistent, high-quality results with minimal setup time.
To use this API, you need an API key. You can get one by creating a free account and visiting your dashboard.
GET Endpoint
https://api.apiverve.com/v1/earthquakeCode Examples
Here are examples of how to call this API in different programming languages:
curl -X GET \
"https://api.apiverve.com/v1/earthquake" \
-H "X-API-Key: your_api_key_here"const response = await fetch('https://api.apiverve.com/v1/earthquake', {
method: 'GET',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);import requests
headers = {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
}
response = requests.get('https://api.apiverve.com/v1/earthquake', headers=headers)
data = response.json()
print(data)const https = require('https');
const url = require('url');
const options = {
method: 'GET',
headers: {
'X-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
}
};
const req = https.request('https://api.apiverve.com/v1/earthquake', options, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => console.log(JSON.parse(data)));
});
req.end();<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.apiverve.com/v1/earthquake');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: your_api_key_here',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
?>package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/earthquake", nil)
req.Header.Set("X-API-Key", "your_api_key_here")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require 'net/http'
require 'json'
uri = URI('https://api.apiverve.com/v1/earthquake')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['X-API-Key'] = 'your_api_key_here'
request['Content-Type'] = 'application/json'
response = http.request(request)
puts JSON.pretty_generate(JSON.parse(response.body))using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "your_api_key_here");
var response = await client.GetAsync("https://api.apiverve.com/v1/earthquake");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}Authentication
This API requires authentication via API key. Include your API key in the request header:
X-API-Key: your_api_key_hereInteractive API Playground
Test this API directly in your browser with live requests and responses.
Parameters
This API does not require any parameters.
Response
The API returns responses in JSON, XML, YAML, Markdown, and CSV formats:
Example Responses
{
"status": "ok",
"error": null,
"data": {
"earthquakes_LastUpdated": 1765922405,
"earthquakes_LastHour": 9,
"earthquakes": [
{
"mag": 0.92,
"place": "6 km W of Cobb, CA",
"time": 1765922097290,
"status": "automatic",
"tsunami": 0,
"sig": 13,
"net": "nc",
"types": ",nearby-cities,origin,phase-data,",
"nst": 8,
"dmin": 0.01295,
"rms": 0.01,
"gap": 90,
"magType": "md",
"type": "earthquake",
"title": "M 0.9 - 6 km W of Cobb, CA",
"coordinates": [
-122.789665222168,
38.8241653442383
]
},
{
"mag": 0.86,
"place": "5 km NNW of The Geysers, CA",
"time": 1765921547590,
"status": "automatic",
"tsunami": 0,
"sig": 11,
"net": "nc",
"types": ",nearby-cities,origin,phase-data,",
"nst": 7,
"dmin": 0.005419,
"rms": 0.04,
"gap": 164,
"magType": "md",
"type": "earthquake",
"title": "M 0.9 - 5 km NNW of The Geysers, CA",
"coordinates": [
-122.785499572754,
38.8171653747559
]
},
{
"mag": 2.25,
"place": "6 km NW of The Geysers, CA",
"time": 1765921522850,
"status": "automatic",
"tsunami": 0,
"sig": 78,
"net": "nc",
"types": ",focal-mechanism,nearby-cities,origin,phase-data,",
"nst": 54,
"dmin": 0.01126,
"rms": 0.05,
"gap": 23,
"magType": "md",
"type": "earthquake",
"title": "M 2.3 - 6 km NW of The Geysers, CA",
"coordinates": [
-122.792831420898,
38.8193321228027
]
},
{
"mag": 3.4,
"place": "153 km SSW of Channel Islands Beach, California",
"time": 1765921110756,
"felt": 1,
"cdi": 2.2,
"mmi": 2.538,
"status": "reviewed",
"tsunami": 0,
"sig": 178,
"net": "us",
"types": ",dyfi,nearby-cities,origin,phase-data,scitech-link,shakemap,",
"nst": 36,
"dmin": 0.479,
"rms": 0.65,
"gap": 247,
"magType": "ml",
"type": "earthquake",
"title": "M 3.4 - 153 km SSW of Channel Islands Beach, California",
"coordinates": [
-119.931,
32.9103
]
},
{
"mag": 0.76,
"place": "3 km SW of Anderson Springs, CA",
"time": 1765921074260,
"status": "automatic",
"tsunami": 0,
"sig": 9,
"net": "nc",
"types": ",nearby-cities,origin,phase-data,",
"nst": 8,
"dmin": 0.01316,
"rms": 0.08,
"gap": 231,
"magType": "md",
"type": "earthquake",
"title": "M 0.8 - 3 km SW of Anderson Springs, CA",
"coordinates": [
-122.709831237793,
38.7556648254395
]
},
{
"mag": 2.01,
"place": "14 km NW of Fillmore, CA",
"time": 1765919646890,
"status": "automatic",
"tsunami": 0,
"sig": 62,
"net": "ci",
"types": ",nearby-cities,origin,phase-data,scitech-link,",
"nst": 65,
"dmin": 0.09047,
"rms": 0.27,
"gap": 40,
"magType": "ml",
"type": "earthquake",
"title": "M 2.0 - 14 km NW of Fillmore, CA",
"coordinates": [
-119.025833333333,
34.4875
]
},
{
"mag": 0.73,
"place": "10 km NW of The Geysers, CA",
"time": 1765919646750,
"status": "automatic",
"tsunami": 0,
"sig": 8,
"net": "nc",
"types": ",nearby-cities,origin,phase-data,",
"nst": 13,
"dmin": 0.01553,
"rms": 0.02,
"gap": 107,
"magType": "md",
"type": "earthquake",
"title": "M 0.7 - 10 km NW of The Geysers, CA",
"coordinates": [
-122.853164672852,
38.8294982910156
]
},
{
"mag": 3,
"place": "69 km W of Nanwalek, Alaska",
"time": 1765919380907,
"status": "automatic",
"tsunami": 0,
"sig": 138,
"net": "ak",
"types": ",origin,phase-data,",
"nst": 129,
"dmin": 0.1,
"rms": 0.6,
"gap": 84,
"magType": "ml",
"type": "earthquake",
"title": "M 3.0 - 69 km W of Nanwalek, Alaska",
"coordinates": [
-153.131,
59.288
]
},
{
"mag": 0.99,
"place": "2 km SE of Home Gardens, CA",
"time": 1765919012560,
"status": "automatic",
"tsunami": 0,
"sig": 15,
"net": "ci",
"types": ",nearby-cities,origin,phase-data,scitech-link,",
"nst": 33,
"dmin": 0.07145,
"rms": 0.18,
"gap": 57,
"magType": "ml",
"type": "earthquake",
"title": "M 1.0 - 2 km SE of Home Gardens, CA",
"coordinates": [
-117.508833333333,
33.8653333333333
]
}
]
}
}<Root>
<status>ok</status>
<error />
<data>
<earthquakes_LastUpdated>1765922405</earthquakes_LastUpdated>
<earthquakes_LastHour>9</earthquakes_LastHour>
<earthquakes>
<mag>0.92</mag>
<place>6 km W of Cobb, CA</place>
<time>1765922097290</time>
<status>automatic</status>
<tsunami>0</tsunami>
<sig>13</sig>
<net>nc</net>
<types>,nearby-cities,origin,phase-data,</types>
<nst>8</nst>
<dmin>0.01295</dmin>
<rms>0.01</rms>
<gap>90</gap>
<magType>md</magType>
<type>earthquake</type>
<title>M 0.9 - 6 km W of Cobb, CA</title>
<coordinates>-122.789665222168</coordinates>
<coordinates>38.8241653442383</coordinates>
</earthquakes>
<earthquakes>
<mag>0.86</mag>
<place>5 km NNW of The Geysers, CA</place>
<time>1765921547590</time>
<status>automatic</status>
<tsunami>0</tsunami>
<sig>11</sig>
<net>nc</net>
<types>,nearby-cities,origin,phase-data,</types>
<nst>7</nst>
<dmin>0.005419</dmin>
<rms>0.04</rms>
<gap>164</gap>
<magType>md</magType>
<type>earthquake</type>
<title>M 0.9 - 5 km NNW of The Geysers, CA</title>
<coordinates>-122.785499572754</coordinates>
<coordinates>38.8171653747559</coordinates>
</earthquakes>
<earthquakes>
<mag>2.25</mag>
<place>6 km NW of The Geysers, CA</place>
<time>1765921522850</time>
<status>automatic</status>
<tsunami>0</tsunami>
<sig>78</sig>
<net>nc</net>
<types>,focal-mechanism,nearby-cities,origin,phase-data,</types>
<nst>54</nst>
<dmin>0.01126</dmin>
<rms>0.05</rms>
<gap>23</gap>
<magType>md</magType>
<type>earthquake</type>
<title>M 2.3 - 6 km NW of The Geysers, CA</title>
<coordinates>-122.792831420898</coordinates>
<coordinates>38.8193321228027</coordinates>
</earthquakes>
<earthquakes>
<mag>3.4</mag>
<place>153 km SSW of Channel Islands Beach, California</place>
<time>1765921110756</time>
<felt>1</felt>
<cdi>2.2</cdi>
<mmi>2.538</mmi>
<status>reviewed</status>
<tsunami>0</tsunami>
<sig>178</sig>
<net>us</net>
<types>,dyfi,nearby-cities,origin,phase-data,scitech-link,shakemap,</types>
<nst>36</nst>
<dmin>0.479</dmin>
<rms>0.65</rms>
<gap>247</gap>
<magType>ml</magType>
<type>earthquake</type>
<title>M 3.4 - 153 km SSW of Channel Islands Beach, California</title>
<coordinates>-119.931</coordinates>
<coordinates>32.9103</coordinates>
</earthquakes>
<earthquakes>
<mag>0.76</mag>
<place>3 km SW of Anderson Springs, CA</place>
<time>1765921074260</time>
<status>automatic</status>
<tsunami>0</tsunami>
<sig>9</sig>
<net>nc</net>
<types>,nearby-cities,origin,phase-data,</types>
<nst>8</nst>
<dmin>0.01316</dmin>
<rms>0.08</rms>
<gap>231</gap>
<magType>md</magType>
<type>earthquake</type>
<title>M 0.8 - 3 km SW of Anderson Springs, CA</title>
<coordinates>-122.709831237793</coordinates>
<coordinates>38.7556648254395</coordinates>
</earthquakes>
<earthquakes>
<mag>2.01</mag>
<place>14 km NW of Fillmore, CA</place>
<time>1765919646890</time>
<status>automatic</status>
<tsunami>0</tsunami>
<sig>62</sig>
<net>ci</net>
<types>,nearby-cities,origin,phase-data,scitech-link,</types>
<nst>65</nst>
<dmin>0.09047</dmin>
<rms>0.27</rms>
<gap>40</gap>
<magType>ml</magType>
<type>earthquake</type>
<title>M 2.0 - 14 km NW of Fillmore, CA</title>
<coordinates>-119.025833333333</coordinates>
<coordinates>34.4875</coordinates>
</earthquakes>
<earthquakes>
<mag>0.73</mag>
<place>10 km NW of The Geysers, CA</place>
<time>1765919646750</time>
<status>automatic</status>
<tsunami>0</tsunami>
<sig>8</sig>
<net>nc</net>
<types>,nearby-cities,origin,phase-data,</types>
<nst>13</nst>
<dmin>0.01553</dmin>
<rms>0.02</rms>
<gap>107</gap>
<magType>md</magType>
<type>earthquake</type>
<title>M 0.7 - 10 km NW of The Geysers, CA</title>
<coordinates>-122.853164672852</coordinates>
<coordinates>38.8294982910156</coordinates>
</earthquakes>
<earthquakes>
<mag>3</mag>
<place>69 km W of Nanwalek, Alaska</place>
<time>1765919380907</time>
<status>automatic</status>
<tsunami>0</tsunami>
<sig>138</sig>
<net>ak</net>
<types>,origin,phase-data,</types>
<nst>129</nst>
<dmin>0.1</dmin>
<rms>0.6</rms>
<gap>84</gap>
<magType>ml</magType>
<type>earthquake</type>
<title>M 3.0 - 69 km W of Nanwalek, Alaska</title>
<coordinates>-153.131</coordinates>
<coordinates>59.288</coordinates>
</earthquakes>
<earthquakes>
<mag>0.99</mag>
<place>2 km SE of Home Gardens, CA</place>
<time>1765919012560</time>
<status>automatic</status>
<tsunami>0</tsunami>
<sig>15</sig>
<net>ci</net>
<types>,nearby-cities,origin,phase-data,scitech-link,</types>
<nst>33</nst>
<dmin>0.07145</dmin>
<rms>0.18</rms>
<gap>57</gap>
<magType>ml</magType>
<type>earthquake</type>
<title>M 1.0 - 2 km SE of Home Gardens, CA</title>
<coordinates>-117.508833333333</coordinates>
<coordinates>33.8653333333333</coordinates>
</earthquakes>
</data>
</Root>status: ok
error:
data:
earthquakes_LastUpdated: 1765922405
earthquakes_LastHour: 9
earthquakes:
- mag: 0.92
place: 6 km W of Cobb, CA
time: 1765922097290
status: automatic
tsunami: 0
sig: 13
net: nc
types: ',nearby-cities,origin,phase-data,'
nst: 8
dmin: 0.01295
rms: 0.01
gap: 90
magType: md
type: earthquake
title: M 0.9 - 6 km W of Cobb, CA
coordinates:
- -122.789665222168
- 38.8241653442383
- mag: 0.86
place: 5 km NNW of The Geysers, CA
time: 1765921547590
status: automatic
tsunami: 0
sig: 11
net: nc
types: ',nearby-cities,origin,phase-data,'
nst: 7
dmin: 0.005419
rms: 0.04
gap: 164
magType: md
type: earthquake
title: M 0.9 - 5 km NNW of The Geysers, CA
coordinates:
- -122.785499572754
- 38.8171653747559
- mag: 2.25
place: 6 km NW of The Geysers, CA
time: 1765921522850
status: automatic
tsunami: 0
sig: 78
net: nc
types: ',focal-mechanism,nearby-cities,origin,phase-data,'
nst: 54
dmin: 0.01126
rms: 0.05
gap: 23
magType: md
type: earthquake
title: M 2.3 - 6 km NW of The Geysers, CA
coordinates:
- -122.792831420898
- 38.8193321228027
- mag: 3.4
place: 153 km SSW of Channel Islands Beach, California
time: 1765921110756
felt: 1
cdi: 2.2
mmi: 2.538
status: reviewed
tsunami: 0
sig: 178
net: us
types: ',dyfi,nearby-cities,origin,phase-data,scitech-link,shakemap,'
nst: 36
dmin: 0.479
rms: 0.65
gap: 247
magType: ml
type: earthquake
title: M 3.4 - 153 km SSW of Channel Islands Beach, California
coordinates:
- -119.931
- 32.9103
- mag: 0.76
place: 3 km SW of Anderson Springs, CA
time: 1765921074260
status: automatic
tsunami: 0
sig: 9
net: nc
types: ',nearby-cities,origin,phase-data,'
nst: 8
dmin: 0.01316
rms: 0.08
gap: 231
magType: md
type: earthquake
title: M 0.8 - 3 km SW of Anderson Springs, CA
coordinates:
- -122.709831237793
- 38.7556648254395
- mag: 2.01
place: 14 km NW of Fillmore, CA
time: 1765919646890
status: automatic
tsunami: 0
sig: 62
net: ci
types: ',nearby-cities,origin,phase-data,scitech-link,'
nst: 65
dmin: 0.09047
rms: 0.27
gap: 40
magType: ml
type: earthquake
title: M 2.0 - 14 km NW of Fillmore, CA
coordinates:
- -119.025833333333
- 34.4875
- mag: 0.73
place: 10 km NW of The Geysers, CA
time: 1765919646750
status: automatic
tsunami: 0
sig: 8
net: nc
types: ',nearby-cities,origin,phase-data,'
nst: 13
dmin: 0.01553
rms: 0.02
gap: 107
magType: md
type: earthquake
title: M 0.7 - 10 km NW of The Geysers, CA
coordinates:
- -122.853164672852
- 38.8294982910156
- mag: 3
place: 69 km W of Nanwalek, Alaska
time: 1765919380907
status: automatic
tsunami: 0
sig: 138
net: ak
types: ',origin,phase-data,'
nst: 129
dmin: 0.1
rms: 0.6
gap: 84
magType: ml
type: earthquake
title: M 3.0 - 69 km W of Nanwalek, Alaska
coordinates:
- -153.131
- 59.288
- mag: 0.99
place: 2 km SE of Home Gardens, CA
time: 1765919012560
status: automatic
tsunami: 0
sig: 15
net: ci
types: ',nearby-cities,origin,phase-data,scitech-link,'
nst: 33
dmin: 0.07145
rms: 0.18
gap: 57
magType: ml
type: earthquake
title: M 1.0 - 2 km SE of Home Gardens, CA
coordinates:
- -117.508833333333
- 33.8653333333333| Field | Value |
| --- | --- |
| status | ok |
| error | |
| earthquakes_LastUpdated | 1765922405 |
| earthquakes_LastHour | 9 |
| earthquakes | {"mag":0.92,"place":"6 km W of Cobb, CA","time":1765922097290,"status":"automatic","tsunami":0,"sig":13,"net":"nc","types":",nearby-cities,origin,phase-data,","nst":8,"dmin":0.01295,"rms":0.01,"gap":90,"magType":"md","type":"earthquake","title":"M 0.9 - 6 km W of Cobb, CA","coordinates":[-122.789665222168,38.8241653442383]}; {"mag":0.86,"place":"5 km NNW of The Geysers, CA","time":1765921547590,"status":"automatic","tsunami":0,"sig":11,"net":"nc","types":",nearby-cities,origin,phase-data,","nst":7,"dmin":0.005419,"rms":0.04,"gap":164,"magType":"md","type":"earthquake","title":"M 0.9 - 5 km NNW of The Geysers, CA","coordinates":[-122.785499572754,38.8171653747559]}; {"mag":2.25,"place":"6 km NW of The Geysers, CA","time":1765921522850,"status":"automatic","tsunami":0,"sig":78,"net":"nc","types":",focal-mechanism,nearby-cities,origin,phase-data,","nst":54,"dmin":0.01126,"rms":0.05,"gap":23,"magType":"md","type":"earthquake","title":"M 2.3 - 6 km NW of The Geysers, CA","coordinates":[-122.792831420898,38.8193321228027]}; {"mag":3.4,"place":"153 km SSW of Channel Islands Beach, California","time":1765921110756,"felt":1,"cdi":2.2,"mmi":2.538,"status":"reviewed","tsunami":0,"sig":178,"net":"us","types":",dyfi,nearby-cities,origin,phase-data,scitech-link,shakemap,","nst":36,"dmin":0.479,"rms":0.65,"gap":247,"magType":"ml","type":"earthquake","title":"M 3.4 - 153 km SSW of Channel Islands Beach, California","coordinates":[-119.931,32.9103]}; {"mag":0.76,"place":"3 km SW of Anderson Springs, CA","time":1765921074260,"status":"automatic","tsunami":0,"sig":9,"net":"nc","types":",nearby-cities,origin,phase-data,","nst":8,"dmin":0.01316,"rms":0.08,"gap":231,"magType":"md","type":"earthquake","title":"M 0.8 - 3 km SW of Anderson Springs, CA","coordinates":[-122.709831237793,38.7556648254395]}; {"mag":2.01,"place":"14 km NW of Fillmore, CA","time":1765919646890,"status":"automatic","tsunami":0,"sig":62,"net":"ci","types":",nearby-cities,origin,phase-data,scitech-link,","nst":65,"dmin":0.09047,"rms":0.27,"gap":40,"magType":"ml","type":"earthquake","title":"M 2.0 - 14 km NW of Fillmore, CA","coordinates":[-119.025833333333,34.4875]}; {"mag":0.73,"place":"10 km NW of The Geysers, CA","time":1765919646750,"status":"automatic","tsunami":0,"sig":8,"net":"nc","types":",nearby-cities,origin,phase-data,","nst":13,"dmin":0.01553,"rms":0.02,"gap":107,"magType":"md","type":"earthquake","title":"M 0.7 - 10 km NW of The Geysers, CA","coordinates":[-122.853164672852,38.8294982910156]}; {"mag":3,"place":"69 km W of Nanwalek, Alaska","time":1765919380907,"status":"automatic","tsunami":0,"sig":138,"net":"ak","types":",origin,phase-data,","nst":129,"dmin":0.1,"rms":0.6,"gap":84,"magType":"ml","type":"earthquake","title":"M 3.0 - 69 km W of Nanwalek, Alaska","coordinates":[-153.131,59.288]}; {"mag":0.99,"place":"2 km SE of Home Gardens, CA","time":1765919012560,"status":"automatic","tsunami":0,"sig":15,"net":"ci","types":",nearby-cities,origin,phase-data,scitech-link,","nst":33,"dmin":0.07145,"rms":0.18,"gap":57,"magType":"ml","type":"earthquake","title":"M 1.0 - 2 km SE of Home Gardens, CA","coordinates":[-117.508833333333,33.8653333333333]} || status | error | earthquakes_LastUpdated | earthquakes_LastHour | earthquakes |
|---|---|---|---|---|
| ok | 1765922405 | 9 | {mag:0.92,place:6 km W of Cobb, CA,time:1765922097290,status:automatic,tsunami:0,sig:13,net:nc,types:,nearby-cities,origin,phase-data,,nst:8,dmin:0.01295,rms:0.01,gap:90,magType:md,type:earthquake,title:M 0.9 - 6 km W of Cobb, CA,coordinates:[-122.789665222168,38.8241653442383]}; {mag:0.86,place:5 km NNW of The Geysers, CA,time:1765921547590,status:automatic,tsunami:0,sig:11,net:nc,types:,nearby-cities,origin,phase-data,,nst:7,dmin:0.005419,rms:0.04,gap:164,magType:md,type:earthquake,title:M 0.9 - 5 km NNW of The Geysers, CA,coordinates:[-122.785499572754,38.8171653747559]}; {mag:2.25,place:6 km NW of The Geysers, CA,time:1765921522850,status:automatic,tsunami:0,sig:78,net:nc,types:,focal-mechanism,nearby-cities,origin,phase-data,,nst:54,dmin:0.01126,rms:0.05,gap:23,magType:md,type:earthquake,title:M 2.3 - 6 km NW of The Geysers, CA,coordinates:[-122.792831420898,38.8193321228027]}; {mag:3.4,place:153 km SSW of Channel Islands Beach, California,time:1765921110756,felt:1,cdi:2.2,mmi:2.538,status:reviewed,tsunami:0,sig:178,net:us,types:,dyfi,nearby-cities,origin,phase-data,scitech-link,shakemap,,nst:36,dmin:0.479,rms:0.65,gap:247,magType:ml,type:earthquake,title:M 3.4 - 153 km SSW of Channel Islands Beach, California,coordinates:[-119.931,32.9103]}; {mag:0.76,place:3 km SW of Anderson Springs, CA,time:1765921074260,status:automatic,tsunami:0,sig:9,net:nc,types:,nearby-cities,origin,phase-data,,nst:8,dmin:0.01316,rms:0.08,gap:231,magType:md,type:earthquake,title:M 0.8 - 3 km SW of Anderson Springs, CA,coordinates:[-122.709831237793,38.7556648254395]}; {mag:2.01,place:14 km NW of Fillmore, CA,time:1765919646890,status:automatic,tsunami:0,sig:62,net:ci,types:,nearby-cities,origin,phase-data,scitech-link,,nst:65,dmin:0.09047,rms:0.27,gap:40,magType:ml,type:earthquake,title:M 2.0 - 14 km NW of Fillmore, CA,coordinates:[-119.025833333333,34.4875]}; {mag:0.73,place:10 km NW of The Geysers, CA,time:1765919646750,status:automatic,tsunami:0,sig:8,net:nc,types:,nearby-cities,origin,phase-data,,nst:13,dmin:0.01553,rms:0.02,gap:107,magType:md,type:earthquake,title:M 0.7 - 10 km NW of The Geysers, CA,coordinates:[-122.853164672852,38.8294982910156]}; {mag:3,place:69 km W of Nanwalek, Alaska,time:1765919380907,status:automatic,tsunami:0,sig:138,net:ak,types:,origin,phase-data,,nst:129,dmin:0.1,rms:0.6,gap:84,magType:ml,type:earthquake,title:M 3.0 - 69 km W of Nanwalek, Alaska,coordinates:[-153.131,59.288]}; {mag:0.99,place:2 km SE of Home Gardens, CA,time:1765919012560,status:automatic,tsunami:0,sig:15,net:ci,types:,nearby-cities,origin,phase-data,scitech-link,,nst:33,dmin:0.07145,rms:0.18,gap:57,magType:ml,type:earthquake,title:M 1.0 - 2 km SE of Home Gardens, CA,coordinates:[-117.508833333333,33.8653333333333]} |
Response Structure
All API responses follow a consistent structure with the following fields:
| Field | Type | Description | Example |
|---|---|---|---|
| status | string | Indicates whether the request was successful ("ok") or failed ("error") | ok |
| error | string | null | Contains error message if status is "error", otherwise null | null |
| data | object | null | Contains the API response data if successful, otherwise null | {...} |
Response Data Fields
When the request is successful, the data object contains the following fields:
| Field | Type | Sample Value |
|---|---|---|
| earthquakes_LastUpdated | number | 1765922405 |
| earthquakes_LastHour | number | 9 |
| [ ] Array items: | array[9] | Array of objects |
| â”” mag | number | 0.92 |
| â”” place | string | "6 km W of Cobb, CA" |
| â”” time | number | 1765922097290 |
| â”” status | string | "automatic" |
| â”” tsunami | number | 0 |
| â”” sig | number | 13 |
| â”” net | string | "nc" |
| â”” types | string | ",nearby-cities,origin,phase-data," |
| â”” nst | number | 8 |
| â”” dmin | number | 0.01295 |
| â”” rms | number | 0.01 |
| â”” gap | number | 90 |
| â”” magType | string | "md" |
| â”” type | string | "earthquake" |
| â”” title | string | "M 0.9 - 6 km W of Cobb, CA" |
| â”” coordinates | array | [-122.789665222168, ...] |
Headers
Required and optional headers for API requests:
| Header Name | Required | Example Value | Description |
|---|---|---|---|
| X-API-Key | Yes | your_api_key_here | Your APIVerve API key. Found in your dashboard under API Keys. |
| Accept | No | application/json | Specify response format: application/json (default), application/xml, or application/yaml |
| User-Agent | No | MyApp/1.0 | Identifies your application for analytics and debugging purposes |
| X-Request-ID | No | req_123456789 | Custom request identifier for tracking and debugging requests |
| Cache-Control | No | no-cache | Control caching behavior for the request and response |
GraphQL AccessALPHA
Most APIVerve APIs support GraphQL queries, allowing you to combine multiple API calls into a single request and retrieve only the data you need. This powerful feature enables you to orchestrate complex data fetching with precise field selection.
Not all APIs support GraphQL. Check the API schema or test in the GraphQL Explorer to confirm availability for this specific endpoint.
Token Cost: Each API called in your GraphQL query consumes its standard token cost.
POST https://api.apiverve.com/v1/graphqlquery {
earthquake {
earthquakes_LastUpdated
earthquakes_LastHour
earthquakes
}
}Note: Authentication is handled via the x-api-key header in your GraphQL request, not as a query parameter.
CORS Support
All APIVerve APIs support Cross-Origin Resource Sharing (CORS) with wildcard configuration, allowing you to call the API directly from browser-based applications without proxy servers.
| CORS Header | Value | Description |
|---|---|---|
| Access-Control-Allow-Origin | * | Accepts requests from any origin |
| Access-Control-Allow-Methods | * | Accepts any HTTP method |
| Access-Control-Allow-Headers | * | Accepts any request headers |
Browser Usage: You can make direct API calls from JavaScript running in the browser without encountering CORS errors. No additional configuration needed.
Rate Limiting
APIVerve implements rate limiting to ensure fair usage and maintain service quality across all users. Rate limits vary by subscription plan and are applied per API key.
| Plan | Rate Limit | Description |
|---|---|---|
| Free | 5 requests/min | Hard rate limit enforced - exceeding will return 429 errors |
| Starter | No Limit | Production ready - no rate limiting or throttling |
| Pro | No Limit | Production ready - no rate limiting or throttling |
| Mega | No Limit | Production ready - no rate limiting or throttling |
Rate Limit Headers
When rate limits apply, each API response includes headers to help you track your usage:
| Header | Description |
|---|---|
| X-RateLimit-Limit | Maximum number of requests allowed per time window |
| X-RateLimit-Remaining | Number of requests remaining in the current window |
| X-RateLimit-Reset | Unix timestamp when the rate limit window resets |
Handling Rate Limits
Free Plan: When you exceed your rate limit, the API returns a 429 Too Many Requests status code. Your application should implement appropriate backoff logic to handle this gracefully.
Paid Plans: No rate limiting or throttling applied. All paid plans (Starter, Pro, Mega) are production-ready.
Best Practices:
- Monitor the rate limit headers to track your usage (Free plan only)
- Implement caching where appropriate to reduce API calls
- Upgrade to Pro or Mega for guaranteed no-throttle performance
Note: Rate limits are separate from token consumption. You may have tokens remaining but still hit rate limits on Free tier.
Client Libraries
To get started with minimal code, most of our APIs are available through client libraries and clients:
Error Codes
The API uses standard HTTP status codes to indicate success or failure:
| Code | Message | Description | Solution |
|---|---|---|---|
| 200 | OK | Request successful, data returned | No action needed - request was successful |
| 400 | Bad Request | Invalid request parameters or malformed request | Check required parameters and ensure values match expected formats |
| 401 | Unauthorized | Missing or invalid API key | Include x-api-key header with valid API key from dashboard |
| 403 | Forbidden | API key lacks permission or insufficient tokens | Check token balance in dashboard or upgrade plan |
| 429 | Too Many Requests | Rate limit exceeded (Free: 5 req/min) | Implement request throttling or upgrade to paid plan |
| 500 | Internal Server Error | Server error occurred | Retry request after a few seconds, contact support if persists |
| 503 | Service Unavailable | API temporarily unavailable | Wait and retry, check status page for maintenance updates |
Need help? Contact support with your X-Request-ID for assistance.
Frequently Asked Questions
How do I get an API key?
What are tokens and how do they work?
Tokens are your API usage currency. Each successful API call consumes tokens based on the API's complexity. Most APIs cost 1 token per call, while more complex APIs may cost 2-5 tokens. Failed requests and errors don't consume tokens. Check the API details above to see the token cost for this specific API.
Can I use this API in production?
The free plan is for testing and development only. For production use, upgrade to a paid plan (Starter, Pro, or Mega) which includes commercial use rights, no attribution requirements, and guaranteed uptime SLAs. All paid plans are production-ready.
Can I use this API from a browser?
What happens if I exceed my token limit?
When you reach your monthly token limit, API requests will return an error until you upgrade your plan or wait for the next billing cycle. You'll receive notifications at 80% and 95% usage to give you time to upgrade if needed.
Was this page helpful?
Help us improve our documentation



