Emergency Numbers API
Disclaimer
This disclaimer is inserted in the all country responses:
The data from this API is provided without any claims of accuracy, you should use this data as guidance, and do your own due diligence.
Data Sources
This information is put together from multiple data sources - the raw data powering this services is available on GitHub where you can raise any issues.
Authentication
No authentication is required for this API, however requests will be rate limited.
Rate Limiting
The API is rate limited to 5 request per second. Rate limited requests will experience a 429 Too Many Requests
header. There will also be a retry after header set.
Errors
Standard HTTP errors will apply. Application errors will also be contained in the body of the response.
The type of query that will generate a consistent response will be requesting an ISO-3361 territory where there is no data available. For instance the request https://emergencynumberapi.com/api/country/AQ
for Antarctica will return:
"error":"No Data for this Territory"
Requesting a non-valid country will result in a 404 response.
Queries
The API can be queried using a GET
request on the following URL.
https://emergencynumberapi.com/api/country/{code}
In this instance the code
can be an ISO3361-1_alpha-2 or ISO3361-1_numeric code.
The API response takes the following form:
{
"disclaimer":"LegalText",
"error":nil,
"data":{}
}
API Responses have an Expires
header of 1 day, it is safe to cache the data for this duration.
Response
Emergency Services
We provide where possible the numbers for the 3 major emergency services. Ambulance, Fire and Police. In some countries there is a central switchboard for all services this is referred to as Dispatch
in this API.
Local Numbers Only
In some countries you are unable to use a common dial for accessing emergency services. In this situation you are required to call your local emergency services directly. In this instance the LocalOnly
flag will be set to true. Even though all the servies are listed, they will not contain any data.
Telephone Networks
This API differentiates between Fixed line (Fixed
), mobile or cell networks (GSM
), and universally accessible numbers (All
). Each emergency service will always have an All
property, even if it is empty, but will only contain network specific numbers where used.
Telephone Numbers
Telephone numbers are always returned as a string of numbers. There may be multiple numbers for any response. Even single numbers will be wrapped in an array.
Example Country Response
In reality the country responses are much simpler then this one here. However this response for an imaginary country will work on the API and is a composite of the situations that we find in the API.
In the imaginary country of Reynholm there is a complicated emergency services numbering system, which conveniently allows us to show all the possible structures that you might experience from our API.
{
"Country":{
"Name":"Rheynolm",
"ISOCode":"XR",
"ISONumeric":"999",
},
"Fire":{"All":[]},
"Ambulance":{"All":[]},
"Police":{
"All":[],
"Special":[{
"Traffic":{"All":["144"]}
}],
},
"Dispatch":{
"All":["01189998819991197253"],
"GSM":["123"],
"Fixed":["012"]
},
"LocalOnly":false,
"Member_112":true,
}
Country
object returns the details about the Country this is all ISO-3361 data. In this instance we are using the User assigned codes XR
and 999
for the fictional country.
Reynholm does operate a system of priority numbers all over their territory, so the LocalOnly
property is set to false
.
Member_112
indicates that the 112 universal number will work in this country. It may be the primary dispatch number or used as a secondary number. Typically this can be used in all EU member states.
Dispatch
Object
The dispatch object for Rheynolm contains 3 elements All
, GSM
and Fixed
indicating the numbers availability on common types of phone network. In this case there is a universal number 01189998819991197253
that will work on Mobile or Landlines. There are also a specific number for land lines only 012
. Mobile phone(cellphone) users can dial 123
.
Police
Object
In this situation there is a special number for reporting traffic accidents to the police.
"Police":{
"All":[],
"Special":[{
"Traffic":{"All":["144"]}
}],
}
The special
element of the police object provides information for specialist numbers within one of the major three emergency services. It is currently only used in two actual records and only for the police. This special ma
Data Dump
A new end point is available for users that want to have access to all the data for caching locally.
Please be aware of the disclaimers and accuracy of the data.
This is available at:
https://emergencynumberapi.com/api/data/all
Response
Is a json array of country objects as described above. This is cache-able for 7 days.