Public API Docs for IP Geolocation

Are you looking for an easy-to-use and reliable API for IP geolocation? Look no further than ipgeolocation.io! Whether you're building a website, application, or other project that requires IP location data, this API has you covered.

API Example Code in JavaScript

To get started, here are some example code snippets in JavaScript for the various endpoints available through the API:

Geolocation Endpoint

// Define your API key
const apiKey = "your_api_key_here";

// Define the IP address you want to get geolocation data for
const ipAddress = "8.8.8.8";

// Make a request to the API's geolocation endpoint
fetch(`https://api.ipgeolocation.io/ipgeo?apiKey=${apiKey}&ip=${ipAddress}`)
  .then(response => response.json())
  .then(data => console.log(data));

Timezone Endpoint

// Define your API key
const apiKey = "your_api_key_here";

// Define the IP address you want to get timezone data for
const ipAddress = "8.8.8.8";

// Make a request to the API's timezone endpoint
fetch(`https://api.ipgeolocation.io/timezone?apiKey=${apiKey}&ip=${ipAddress}`)
  .then(response => response.json())
  .then(data => console.log(data));

Currency Endpoint

// Define your API key
const apiKey = "your_api_key_here";

// Define the currency you want to convert to (in ISO 4217 format)
const currencyCode = "EUR";

// Define the amount you want to convert (in USD)
const amount = 50;

// Make a request to the API's currency endpoint
fetch(`https://api.ipgeolocation.io/currency?apiKey=${apiKey}&currency=${currencyCode}&amount=${amount}`)
  .then(response => response.json())
  .then(data => console.log(data));

Conclusion

With its easy-to-use API and wide range of features, ipgeolocation.io is a top choice for IP geolocation data. Whether you need geolocation, timezone, or currency data, this API has you covered. So why not try it out today and start building your project with confidence?

Related APIs