Skip to content

IP2Location.io API

by ip2location.io

API keyHTTPSGeocoding
Open documentation ↗

Overview

Bundle of Free IP geolocation and WHOIS API

IP2Location.io is a geocoding API from ip2location.io. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 1 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Category
Geocoding
Base URL
https://api.ip2location.io
Version
1.0
Endpoints
1
Spec updated
2023-02-17

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.ip2location.io/" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("https://api.ip2location.io/", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://api.ip2location.io/",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/Geolocate user's location information via IP address

Questions

Does the IP2Location.io API need an API key?

Yes. The IP2Location.io API uses API key authentication; the documentation explains how to get credentials.

Does the IP2Location.io API support HTTPS?

Yes, the IP2Location.io API is served over HTTPS.

How many endpoints does the IP2Location.io API have?

Its OpenAPI description lists 1 endpoint in version 1.0. All of them are shown on this page.

What are alternatives to the IP2Location.io API?

Other Geocoding APIs include Bing Maps, ip-api, OpenStreetMap, GeographQL, IP Address Details.

Compare alternatives →

Listed from public-apis database (MIT), APIs.guru (CC0).