Error Handling
Understanding the errors returned by the IP Location API is crucial for effective integration and troubleshooting. This page outlines the various error responses you might encounter, their causes, and how to resolve them.
Error Statuses and Their Causes
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. - Invalid or missing
ip
address: Theip
parameter is required and must be a valid IP address.
Example Response:
{
"error": true,
"errorMessage": "Invalid or missing apiKey parameter."
}
401 Unauthorized
This error occurs when the provided apiKey
is invalid.
Example Response:
{
"error": true,
"errorMessage": "Invalid or missing apiKey parameter."
}
415 Unsupported Media Type
This error occurs when the Content-Type of the request is not application/json
.
Example Response:
{
"error": true,
"errorMessage": "Content-Type must be application/json."
}
429 Too Many Requests
This error occurs when the number of API calls made with the provided apiKey
has exceeded the allowed limit.
Example Response:
{
"error": true,
"errorMessage": "API limit exceeded. Please upgrade your plan through the Dashboard."
}
500 Internal Server Error
This error indicates that something went wrong on the server side. It could be due to various reasons, such as a temporary server issue or an unexpected error in processing the request.
Example Response:
{
"error": true,
"errorMessage": "Internal Server Error."
}
How to Fix Errors
- Invalid or Missing
apiKey
: Ensure you are including a validapiKey
in either the request header or body. You can obtain yourapiKey
by signing up for a Free Trial. - Invalid or Missing
ip
Address: Ensure theip
parameter is included in your request body and contains a valid IP address. - API Limit Exceeded: If you have exceeded your API usage limit, consider upgrading your plan through the Dashboard to increase your quota. You will receive email notifications when your usage limit reaches 80%.
- Unsupported Media Type: Ensure that the Content-Type of your request is set to
application/json
. - Server Issues: If you encounter a
500 Internal Server Error
, try again later. If the issue persists, contact support.