Ip2Geo API
The Ip2Geo API turns IPv4 and IPv6 addresses into geolocation data (continent, country, region, city, coordinates, time zone, currency and ASN), and lets your…
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
The Ip2Geo API turns IPv4 and IPv6 addresses into geolocation data (continent, country, region, city, coordinates, time zone, currency and ASN), and lets your server read back the conversions your project made.
Authentication. Every request carries an API key in the x-api-key header. A secret key (i2g_sk_...) belongs on your server and works on every operation. A public key (i2g_pk_...) is made for browsers: it is tied to one registered domain, and the request's Origin header must match it. Browsers set Origin themselves, but any other client can set it to anything, so anyone who copies a public key from a page can use it. That is why a public key can only convert addresses, which count toward your quota, and can never read data.
Quota. Every address you send counts toward your plan's conversions, valid or not, and a project over its limit gets 429 on every operation.
Retention. Conversions are kept for the current month and the twelve before it.
Responses. Every answer, error or not, is the same JSON envelope: success, code (the HTTP status), message, data and _req.
This document is published at https://ip2geo.dev/openapi.json.
Endpoints 5
Convert
- GETConvert IP
/convert?ip=8.8.4.4Converts one IPv4 or IPv6 address into its geolocation data. Every address sent counts toward your quota, valid or not. A valid address the datasets hold no… - POSTBulk convert IPs
/convertConverts up to 5,000 IPv4 or IPv6 addresses in one request and answers one item per address, in the order sent. An invalid address, or a valid one without a…
Conversions
- GETGet conversion
/conversions/get?conversionId=01a12452-07a0-7a3b-8c41-d2e5f6a7b8c9Retrieves one of your project's conversions by its uniqueId. Conversions are kept for the current month and the twelve before it, so an older id answers 404,… - POSTGet conversions
/conversions/getRetrieves up to 100 of your project's conversions by their uniqueId. Ids that are unknown, another project's, or older than the current month and the twelve… - GETList conversions
/conversions/listLists your project's conversions, newest first, in pages of up to 50, over the current month and the twelve before it. Secret keys only: a public key gets 403.
API details
- Base URL
https://api.ip2geo.dev- Authentication
- An API key in the x-api-key header
An API key in the x-api-key header - Operations
- 5 operations on 3 pathsGET 3POST 2
- Main resources
- Conversions 3Convert 2
- Response formats
application/json- Description format
- OpenAPI 3.0.3, API version
1.1.0 - Links
- OpenAPI document
- Listed from
- Ip2geo's published OpenAPI description
How to test the Ip2Geo API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Ip2Geo API collection, without the publisher's secrets.
- Add your credentialsThis API uses an API key in the x-api-key header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Convert IP” (GET /convert?ip=8.8.4.4), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Ip2Geo API?
The Ip2Geo API turns IPv4 and IPv6 addresses into geolocation data (continent, country, region, city, coordinates, time zone, currency and ASN), and lets your… It is listed under Maps & location and has 5 endpoints.
Who publishes the Ip2Geo API?
It is listed from Ip2Geo's public API description (an OpenAPI document), not published by Ip2Geo on Swastik Codes. Anyone who controls ip2geo.dev can claim the profile by adding a DNS TXT record.
What is the base URL of the Ip2Geo API?
Requests go to https://api.ip2geo.dev. Endpoint paths are added to this base URL.
How do I authenticate with the Ip2Geo API?
It accepts 2 methods: an API key in the x-api-key header; an API key in the x-api-key header.
How many endpoints does the Ip2Geo API have?
5 operations on 3 paths (3 GET, 2 POST). The largest groups are Conversions, Convert.
Is forking the Ip2Geo API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.