Docs / Location

Calling IP

Reads the calling device from Cloudflare. This does not look the address up in the DB-IP database.

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

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

const location = await client.callerIp();

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.

Response

A 200 response uses one call. source is cloudflare. attribution and attribution_url are null on this call.

Errors

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

StatusCodeWhen
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.