GetEarthquakeProbability API
For a specified location, the GetEarthquakeProbability API returns:
-
The latitude and longitude of the location.
-
The current expected rate of earthquakes of specified magnitude over a specifiec time window.
-
The current exptected probability of experiencing at least one such earthquake.
The GetEarthquakeProbability Web Service is located at:
http://api.openhazards.com/GetEarthquakeProbability.xml.
The parameters of the API are:
| Parameter | Description | Required |
|---|---|---|
| q | The geographical location to query. This can be a city name, street adress, etc. The parameter type is a text string. | Yes |
| w | The calculation window (in days) for the forecast. The parameter type is an integer. Default value: 365 (1 year). | No |
| m | The magnitude threshold for the forecast. The parameter type is a float. Default value: 6.0. | No |
| r | The calculation radius (in km) for the forecast. The parameter type is an integer. Default value: 50 (approximately 31 miles) . | No |
The results returned by the API are:
| Parameter | Description |
|---|---|
| location |
The resulting parsed location for the calculation:
|
| forecast |
The calculation results:
|
Messages and Codes:
The following table summarizes possible return codes from the API:
| Error Code | Description | Resolution |
|---|---|---|
| 0 | No location was specified | Check if you have provided a geographical location in your API call. |
| 1 | Location could not be found | Check the provided geographical location for spelling mistakes. |









