Docs / Countries

Get a division by code

Returns one division of a country, including its children.

GET/v1/countries/{code}/divisions/{divisionCode}
import { Client } from "@liveapiio/liveapi";

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

const division = await client.divisionByCode("TR", "34");

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
codestringISO country code. Path parameter.
divisionCodestringDivision code inside that country, such as 34. Path parameter.

Response

A 200 response uses one call. The division includes a children array.

Errors

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

StatusCodeWhen
404not_foundCountry or division not found.
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.