Docs / Location

Look up an IP

Looks up one IPv4 or IPv6 address in the DB-IP Country Lite database.

GET/v1/ip/{ip}
import { Client } from "@liveapiio/liveapi";

const client = new Client({ token: process.env.LIVEAPI_TOKEN });

const location = await client.lookupIp("8.8.8.8");

Request

Send Authorization: Bearer YOUR_TOKEN. The token stays on your server. Each library reads it from the environment and calls this endpoint for you.

FieldTypeDescription
ipstringIPv4 or IPv6 address. Path parameter.

Response

A 200 response uses one call. The JSON keeps source "db-ip", attribution "IP Geolocation by DB-IP", and attribution_url "https://db-ip.com". is_tor, is_hosting, and hosting_provider flag Tor exit nodes and published cloud ranges; they are null when that data is not loaded.

Errors

A failed request returns { "error": { "code", "message" } } and does not use a call.

StatusCodeWhen
404not_foundNo location record for this address.
503upstream_unavailableThe location database is not loaded.
401unauthorizedThe bearer token is missing or not recognized.

We value your privacy

We use necessary cookies to run this website. With your consent, we would also like to use analytics and marketing cookies. Read our cookie policy.