Docs / Location
One field of the calling IP
Returns one field of the calling device as plain text. The value comes from Cloudflare, not DB-IP.
GET
/v1/ip/{field}import { Client } from "@liveapiio/liveapi";
const client = new Client({ token: process.env.LIVEAPI_TOKEN });
const country = await client.callerField("country");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.
| Field | Type | Description |
|---|---|---|
| field | string | country, country_name, city, region, region_code, postal, latitude, longitude, latlong, timezone, utc_offset, org, asn, currency, continent, or calling_code. |
Response
A 200 response uses one call. The body is the field value as text, not a JSON object. An empty field returns 404.
Errors
A failed request returns { "error": { "code", "message" } } and does not use a call.
| Status | Code | When |
|---|---|---|
| 404 | not_found | Unknown field, or this field is empty for the calling device. |
| 401 | unauthorized | The bearer token is missing or not recognized. |