Authentication
To access the IP Location API, you need to authenticate your requests using an API key. You can pass the API key in the request header or body.
Getting Your API Key
Sign up for a Free Trial to receive your API key. We'll email it right to you after sign up.
Security Note
Make sure to keep your API key secure and do not expose it in your client-side code.
Passing the API Key
In the Header
Include the API key in the apikey
header:
apikey: your-api-key-here
In the Request Body
Include the API key as a field in the JSON body:
{
"apiKey": "your-api-key-here",
"ip": "101.49.50.12"
}
Error Handling
If your request is not authenticated, you will receive an error response. Ensure that apiKey
is correct and properly formatted. Here is an example of an error response:
400 Bad Request
This error occurs when there is an issue with the request you sent to the API. Common causes include:
- Invalid or missing
apiKey
: TheapiKey
parameter is required either in the header or the body of the request.
Example Response:
{
"error": true,
"errorMessage": "Invalid or missing apiKey parameter."
}
401 Unauthorized
Example Response:
{
"error": true,
"errorMessage": "Invalid or missing apiKey parameter."
}