Skip to content

Getting Started

You can use the IP-Sonar API to get information about IP addresses, including countries, cities, and even the approximate latitude and longitude.

Feel free to use the API in your applications, websites, or services. It is designed to be easy to use and integrate.

Production API is available at https://api.ip-sonar.com

It’s straightforward to use. You may send a request to check your IP address geolocation:

Terminal window
curl https://api.ip-sonar.com/v1/myip

You can check any IP address by sending a request to the API:

Terminal window
curl https://api.ip-sonar.com/v1/216.8.112.107

You will see a response like this:

{
"accuracy_radius": 50,
"city_name": "Cleveland",
"continent_code": "NA",
"continent_name": "North America",
"country_code": "US",
"country_name": "United States",
"ip": "216.8.112.107",
"is_in_eu": false,
"latitude": 41.4377,
"longitude": -81.5487,
"postal_code": "44128",
"subdivision_1_code": "OH",
"subdivision_1_name": "Ohio",
"timezone": "America/New_York"
}

Use API keys to authenticate. Authenticated requests have a higher rate limit. You can add API key in dashboard.

Use the X-Api-Key header to authenticate your requests:

Terminal window
curl -H "X-Api-Key: YOUR_API_KEY" https://api.ip-sonar.com/v1/216.8.112.107

That’s it! In the next sections, we will cover field masks, rate limits, and batch requests to get the most out of the API.