IP address to geographic location
The 'IP Address to Location' API allows an IP address to be translated in to a geographical location
Important: You will need an API key to use this API. Register for a free account here.
Features:
- Country Code
- Country Name
- City
Usage
Post a JSON array containing an api_key and and ip_address to http://msapi.com/ipaddress_location
{"api_key":"abcdefghijklmnopqrstuvwxyz","ip_address":"127.0.0.1"}
Sample output
The resulting output is a JSON array containing the original IP address, a country code, a country name and a city location
{"response":{"ip_address":"127.0.0.1","country_code":"IE","country_name":"Ireland","city":"Cork"}}
Parameters
| Preference | Default Value | Options | Description |
|---|---|---|---|
| api_key | Required | None | Your API Key |
| ip_address | Required | None | An IPv4 address |
Error codes
| Error notice | Cause |
|---|---|
| Error, Invalid API Key | An invalid API key has been passed to the API |
| Error, Missing API Key | No API Key has been passed to the API |
| Error, Missing IP address | No IP address has been passed to the API |
| Error, Missing API Key & IP address | Neither an API Key nor an IP address have been passed to the API |
Credits
This API is made possible by the IP address and location databases provided by MaxMind. This API is updated with new information monthly.