Docs / Postal codes

Look up a postal code

Returns the places and approximate coordinates for a postal code. Coordinates are area centroids, not street addresses.

GET/v1/postal-codes/{country}/{code}
import { Client } from "@liveapiio/liveapi";

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

const postal = await client.postalCode("US", "90210");

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
countrystringISO country code. Path parameter.
codestringPostal code. Spaces and hyphens are ignored. Path parameter.

Response

A 200 response uses one call. In CA, IE, NL, and GB the source holds only the leading part of each code, so a longer code can match with match set to partial.

Errors

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

StatusCodeWhen
404not_foundUnknown code or country.
503data_unavailablePostal code data is not available right now.
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.