IP Geolocation API
Country and network owner for IPv4 and IPv6 addresses from DB-IP's open data: continent, country, EU membership, the address block around each address, AS number and network name. One record per address, up to 1,000 per run.
$2 per 1,000 records
You pay only for the records you get. Zero records cost zero. 2,500 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.
Data from db-ip.com/db/download/ip-to-country-lite
Get this data
Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.
Try it
Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 2,500 records of this API, no card. Create a free key
For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
- Small runs answer in the same request; longer ones answer
202with a run to poll. fieldsreturns only the fields you name. The examples send the ones picked on this page.Idempotency-Keyis optional. A retry with it is never charged twice.- You pay for records returned. Zero records cost zero.
curl -X POST "https://pullrow.dev/v1/apis/ip-geolocation/run" \
-H "Authorization: Bearer $PULLROW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"ips":["1.0.0.1","8.8.8.8"]},"max_items":50}'Inputs
Send them as input in the request body. Leave one out to use its default.
What's in each record
12 fields.
Basics
- Ip
The address looked up, in its standard written form (IPv6 shortened, lower-case).
Example 1.0.0.1
- Ip version
4 or 6.
Example 4
- Reserved
True for private, loopback, link-local, shared, multicast, documentation and other special-use addresses, which have no location.
Example No
- Continent code
Two-letter continent code: AF, AN, AS, EU, NA, OC or SA.
Example OC
- Continent
Continent name, such as Europe.
Example Oceania
- EU
Yes when the country is one of the 27 EU member states.
Example No
- Asn
Number of the autonomous system (network) that holds the address, such as 15169.
Example 13,335
- As name
Name of the organisation behind that network, such as Google LLC.
Example Cloudflare, Inc.
- Network range
The block of addresses that network holds around this one, as first-last.
Example 1.0.0.0-1.0.0.255
Location
- Country code
ISO 3166-1 two-letter country code, such as US.
Example AU
- Country
Country name in English, such as United States.
Example Australia
- Country range
The block of addresses around this one placed in the same country, as first-last; every address in it gets the same country.
Example 1.0.0.0-1.0.0.255
Technical detailsField names and types for developers
Field names and types
The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.
| Field name | Type | Shown on this page as | Filled |
|---|---|---|---|
ip | text | Ip | 3 of 3 |
ip_version | number | Ip version | 3 of 3 |
is_reserved | yes or no | Reserved | 3 of 3 |
continent_code | text | Continent code | 3 of 3 |
continent | text | Continent | 3 of 3 |
country_code | text | Country code | 3 of 3 |
country | text | Country | 3 of 3 |
is_eu | yes or no | EU | 3 of 3 |
country_range | text | Country range | 3 of 3 |
asn | number | Asn | 3 of 3 |
as_name | text | As name | 3 of 3 |
network_range | text | Network range | 3 of 3 |
How it reads the site
Runs on a reader we built and maintain by hand for this site.
Save as pipeline
A pipeline remembers this API, your inputs and the fields you picked. It can run on a schedule and email you the results.
Sample records
| Record | Ip | Ip version | Reserved | Continent code | Continent | EU | Asn | As name | Network range | Country code | Country | Country range |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1.0.0.1 | 4 | No | OC | Oceania | No | 13,335 | Cloudflare, Inc. | 1.0.0.0-1.0.0.255 | AU | Australia | 1.0.0.0-1.0.0.255 |
| 2 | 8.8.8.8 | 4 | No | NA | North America | No | 15,169 | Google LLC | 8.8.8.0-8.8.8.255 | US | United States | 8.7.245.0-8.8.235.255 |
| 3 | 193.0.6.139 | 4 | No | EU | Europe | Yes | 3,333 | Reseaux IP Europeens Network Coordination Centre (RIPE NCC) | 193.0.0.0-193.0.7.255 | NL | Netherlands | 193.0.0.0-193.0.23.255 |
Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.
Reliability
Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.
Incidents and repairs
How it is kept working What a repair can't do
A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.
- You pay only for records returned. A run that returns none costs nothing.
- Country and network level only: region, city, postal code and coordinates are not part of this API.
- Data comes from DB-IP's IP to Country Lite and IP to ASN Lite databases (CC BY 4.0), refreshed monthly: show 'IP Geolocation by DB-IP' with a link to db-ip.com wherever you show or use the results.
- Free Lite data is less precise than paid databases: mobile, satellite, VPN and cloud addresses often show the network's registered country rather than the user's.
- Up to 1,000 addresses per run. Entries that are not IPv4 or IPv6 addresses are skipped and repeats are answered once; a port or IPv6 zone is ignored and ::ffff: addresses are read as IPv4.
- Private, loopback, link-local, multicast and documentation addresses come back with is_reserved true and no country or network. Unallocated or unannounced addresses come back with those fields empty.
- Continent follows the GeoNames split (Turkey and the Caucasus in Asia, Russia and Cyprus in Europe); is_eu means one of the 27 EU member states.
- Each address costs a few small reads of the monthly data files, shared across a run: about 10 to 20 seconds for 100 addresses and up to about 2 minutes for 1,000.
Version history
A run uses the live version unless the request names another one with version.
Manage this API
Only your workspace sees this part.
Automatic repair
Off: a rebuilt version is stored and waits for you in the version history.
Delete this API
Removes the API, its versions and the saved records of its runs. Calls to its address then answer 404. Records already charged stay charged. This cannot be undone.