1. Base URL

The MapAlerter API is located at the following base URL:

https://api.mapalerter.com/component/api

Therefore all requests to the MapAlerter API must go through this base URL.


2. Select a Task

Like any API, it is necessary to outline the request using the following URL parameter:

https://api.mapalerter.com/component/api?task=<TaskName>

There are currently 2 API GET requests that can be made:

Example:

https://api.mapalerter.com/component/api?task=search
https://api.mapalerter.com/component/api?task=geo

3. Pass an API Key

It is necessary to pass an API key for all requests. You can register for a free MapAlerter API account which will entitle you to 25000 requests per day. The API key is passed as a compulsory parameter in all API requests as follows:

https://api.mapalerter.com/component/api?key=<API-KEY>

Example:

https://api.mapalerter.com/component/api?key=dec418c88da994717af72a851d21e980

4. Response Format

The API returns results in XML, JSON or JSONP and the preferred format should be specified. If not format is specified then the request will default to XML.

https://api.mapalerter.com/component/api?format=<RESPONSE-FORMAT>

Example:

https://api.mapalerter.com/component/api?format=xml

5. Overview of a simple API request

Putting the above 4 points into a single structure, the following represents the basic requirements for any API request

https://api.mapalerter.com/component/api?key=<API-KEY>&task=<TaskName>&format=<RESPONSE-FORMAT>

Example:

https://api.mapalerter.com/component/api?key=dec418c88da994717af72a851d21e980&task=geo&format=xml

Individual API requests also have compulsory parameters. For example, the "Geo-Query" is based on a location search, so coordinates are required in the API request. However these are not required in the basic search API task.



6. Callback Parameter (only required for JSONP)

An additional parameter is required if you intend on consuming alert data using JSONP

https://api.mapalerter.com/component/api?key=<API-KEY>&task=<TaskName>&format=jsonp&callback=?

Example:

https://api.mapalerter.com/component/api?key=dec418c88da994717af72a851d21e980&task=geo&format=jsonp&callback=?

This callback parameter is not required for JSON or XML.