API Reference

IP Geolocation (DB-IP Lite)

Look up the country, region, city, coordinates, and the network ASN and organisation of an IPv4 or IPv6 address, including the caller's own address via /ip/me. The data is DB-IP Lite (IP to City Lite and IP to ASN Lite), licensed CC BY 4.0 and refreshed by DB-IP every month. DB-IP itself describes the Lite editions as subsets with reduced coverage and accuracy compared with its commercial database, so city-level results are approximate.

Data as of · Source: DB-IP Lite (IP Geolocation by DB-IP)

Main endpoint
GET https://use.apiindonesia.id/api/v1/ip/:ip
Endpoints
3
Authentication
x-api-key header (create one free in the dashboard)
Price
2 credits (Rp2) per successful request; failed requests are free
Format
JSON (REST), with cURL, JavaScript and Python examples
Data source
IP Geolocation by DB-IP (https://db-ip.com). Data source: DB-IP Lite (https://db-ip.com/db/lite.php), licensed under the Creative Commons Attribution 4.0 International licence (CC BY 4.0). Every successful response carries meta.attribution with the credit line, the licence, a licence link, a link to db-ip.com and the statement of changes. The DB-IP licence requires web applications that display or use the results to include a link back to DB-IP.com, for example the text "IP Geolocation by DB-IP" linked to https://db-ip.com, so that obligation also applies to your application when it shows results from this API. What API Indonesia changed: IP ranges and locations were normalised to JSON, and "ZZ" (private/reserved) ranges are reported as reserved: true with null location fields. API Indonesia is not affiliated with or endorsed by DB-IP.
Product Brief

What this API gives you

Look up the country, region, city, coordinates, and the network ASN and organisation of an IPv4 or IPv6 address, including the caller's own address via /ip/me. The data is DB-IP Lite (IP to City Lite and IP to ASN Lite), licensed CC BY 4.0 and refreshed by DB-IP every month. DB-IP itself describes the Lite editions as subsets with reduced coverage and accuracy compared with its commercial database, so city-level results are approximate.

IP Geolocation by DB-IP (https://db-ip.com). Data source: DB-IP Lite (https://db-ip.com/db/lite.php), licensed under the Creative Commons Attribution 4.0 International licence (CC BY 4.0). Every successful response carries meta.attribution with the credit line, the licence, a licence link, a link to db-ip.com and the statement of changes. The DB-IP licence requires web applications that display or use the results to include a link back to DB-IP.com, for example the text "IP Geolocation by DB-IP" linked to https://db-ip.com, so that obligation also applies to your application when it shows results from this API. What API Indonesia changed: IP ranges and locations were normalised to JSON, and "ZZ" (private/reserved) ranges are reported as reserved: true with null location fields. API Indonesia is not affiliated with or endorsed by DB-IP.

Coverage
3

ready-to-use endpoints in this product, with JSON responses and consistent error handling.

Access
API key

Can be tried with the 3,000 credit signup bonus, then used in production through one API Indonesia key.

Sample resource
https://use.apiindonesia.id/api/v1/ip/:ip

Country (ISO 3166-1 alpha-2 code), continent code, region, city, latitude/longitude, the ASN with its organisation name, and the DB-IP range the address falls in. IPv6 can be written directly in the path; IPv4-mapped addresses (::ffff:a.b.c.d) are looked up as IPv4. An invalid address answers 400 and an address with no matching range answers 404; neither is charged.

Example product scenarios

This section separates the product page from the docs. The docs explain how to call endpoints; this page explains why the endpoints make sense for your feature.

  • Personalisation & localisation: pick a default language, currency or time zone from the visitor's country.
  • Security & lightweight fraud checks: flag logins or transactions from an unusual country or ASN for extra review.
  • Analytics: group access logs by country, city or network operator without maintaining your own IP database.

Example Usage

Request
curl "https://use.apiindonesia.id/api/v1/ip/36.66.0.1" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200 OK
{
  "success": true,
  "data": {
    "ip": "36.66.0.1",
    "version": 4,
    "reserved": false,
    "continent_code": "AS",
    "country_code": "ID",
    "region": "Jakarta",
    "city": "Jakarta",
    "latitude": -6.18354,
    "longitude": 106.824,
    "asn": { "number": 7713, "organization": "Telekomunikasi Indonesia (PT)" },
    "network": { "start": "36.66.0.0", "end": "36.66.0.255" }
  },
  "meta": {
    "attribution": {
      "source": "IP Geolocation by DB-IP",
      "license": "CC BY 4.0",
      "license_url": "https://creativecommons.org/licenses/by/4.0/",
      "source_url": "https://db-ip.com",
      "attribution_page": "https://db-ip.com/db/lite.php",
      "notice": "Data diubah: rentang IP dan lokasi dinormalisasi ke format JSON API Indonesia; rentang \"ZZ\" dilaporkan sebagai reserved. Bukan endorsement dari DB-IP."
    }
  }
}

Related Articles

Pricing 2 credits (Rp2) per successful request; failed requests are free. One-time 3,000 credit signup bonus, no credit card, no monthly allowance.

IP Geolocation (DB-IP Lite) API questions

What data is returned?

Country code, continent code, region, city, latitude/longitude, ASN and organisation name, and the DB-IP range the address falls in, for IPv4 and IPv6.

How accurate are the results?

The data is DB-IP Lite, which DB-IP describes as a subset with reduced coverage and accuracy compared with its commercial edition. Country is generally more reliable than city; treat city and coordinates as approximate.

Do I need to show an attribution?

Yes, when your application displays or uses the results on a web page. DB-IP's CC BY 4.0 licence requires a link back, for example "IP Geolocation by DB-IP" linking to https://db-ip.com. Every response already carries meta.attribution.

How is the batch priced?

POST /api/v1/ip/batch is priced per call: 100 credits for 1 to 100 addresses. For fewer than 50 addresses, calling /ip/{ip} one by one (2 credits per call) is cheaper.

Get Started

Start Integrating
Today

Sign up for free and get a 3,000 credit bonus (Rp3,000) once your email is verified, grab an API key, and call your first endpoint right away. No credit card, no tedious approval process.

Dot wave visualization