Bearer-authenticated GET endpoints to list countries and subdivisions from your server (same private API key as validation)
Use these endpoints when your backend needs the same country and subdivision lists that power the widget. Authentication uses your private API key exactly like the Backend Validation API. Geolocation-based preselection is not applied on this surface.
GET listings for countries and subdivisions using your private Bearer token.
Returns a JSON array of country objects. Response includes X-Selected-Language.
This example uses the following configuration:
Include your private API key as a Bearer token: Authorization: Bearer YOUR_PRIVATE_KEY. Base URL: https://api.countriesdb.com.
Preferred language for ICU display names.
Force a specific language (overrides browser preferences).
Fallback language when the preferred language cannot be resolved.
country_name_source controls how the name field is generated: default (ICU display name, translated) or iso (ISO short name, English-only).
The API returns the following fields in each item:
String. Country code (ISO 3166-1 alpha-2).
String. Display name in the selected language.
String. Country code (ISO 3166-1 alpha-3).
String. Country code (ISO 3166-1 numeric, zero-padded to 3 digits).
Object or null. When present: { independent: boolean, status: string }.
String. Last update timestamp (ISO 8601).
Object or null. When present: { parent_country_code: string, subdivision_code: string }.
Returns a JSON array of subdivision objects for the given ISO 3166-1 alpha-2 country code. Empty array when the subscription plan does not include subdivision access.
This example uses the following configuration:
{country} - two-letter country code (e.g. US).
Preferred language for official subdivision names and type names when available.
Force a specific language (overrides browser preferences).
Fallback language when the preferred language cannot be resolved.
When extended translations are available, prefer_official=1 switches to official ISO subdivisions. See widget option docs.
Prefer local variant names when available. Applies to official ISO subdivisions and is ignored when extended translations are active. See widget option docs.
Comma-separated preference list (e.g. un,bgn,default). Applies to official ISO subdivisions and is ignored when extended translations are active. See widget option docs.
The API returns the following fields in each item:
String. Subdivision code (ISO 3166-2).
String. Subdivision display name in the selected language.
String or null. Subdivision type name (e.g. "State"). Null when extended translations are active (type names are only returned for official ISO subdivisions).
String. Last update timestamp (ISO 8601).
String or null. Present for redirect entries that point to another country.
String or null. Present for redirect entries that point to another subdivision code.
Object or null. When present: { parent_country_code: string, subdivision_code: string }.