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.

Try it
Ready-made, maintained by usRecords, 12 fieldsv1.0

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

Ips
IPv4 or IPv6 addresses to look up, such as ["8.8.8.8", "2606:4700:4700::1111"]. Up to 1,000 per run. One per line, or separated by commas.
Example: 1.0.0.1, 8.8.8.8

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
Endpoint
POSThttps://pullrow.dev/v1/apis/ip-geolocation/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
2,500 free records of this API to start. No card.
curl
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.

ipslistrequired
IPv4 or IPv6 addresses to look up, such as ["8.8.8.8", "2606:4700:4700::1111"]. Up to 1,000 per run.
example: 1.0.0.1, 8.8.8.8

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 nameTypeShown on this page asFilled
iptextIp3 of 3
ip_versionnumberIp version3 of 3
is_reservedyes or noReserved3 of 3
continent_codetextContinent code3 of 3
continenttextContinent3 of 3
country_codetextCountry code3 of 3
countrytextCountry3 of 3
is_euyes or noEU3 of 3
country_rangetextCountry range3 of 3
asnnumberAsn3 of 3
as_nametextAs name3 of 3
network_rangetextNetwork range3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordIpIp versionReservedContinent codeContinentEUAsnAs nameNetwork rangeCountry codeCountryCountry range
11.0.0.14NoOCOceaniaNo13,335Cloudflare, Inc.1.0.0.0-1.0.0.255AUAustralia1.0.0.0-1.0.0.255
28.8.8.84NoNANorth AmericaNo15,169Google LLC8.8.8.0-8.8.8.255USUnited States8.7.245.0-8.8.235.255
3193.0.6.1394NoEUEuropeYes3,333Reseaux IP Europeens Network Coordination Centre (RIPE NCC)193.0.0.0-193.0.7.255NLNetherlands193.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.
Known limits
  • 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.