Docs / Phone
Calling codes
Lists country calling codes. Pass country to read one country.
GET
/v1/phones/codesimport { Client } from "@liveapiio/liveapi";
const client = new Client({ token: process.env.LIVEAPI_TOKEN });
const codes = await client.callingCodes("TR");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 |
|---|---|---|
| country | string | Optional ISO country code. |
Response
A 200 response uses one call. Returns an array of calling codes.
Errors
A failed request returns { "error": { "code", "message" } } and does not use a call.
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | The bearer token is missing or not recognized. |