Regions

Retrieve information about administrative subdivisions (states, provinces, territories, prefectures, etc.) as defined by ISO 3166-2.

Standards Used

  • ISO 3166-2
  • IANA TZDB
  • ISO 3166-1

The Region object#

FieldTypeRequiredDescription
codestringYesISO 3166-2 code (e.g., "US-CA").
Example: US-CA
code_altstringNoAlternative code where ambiguity exists.
Example: CA
countrystringYesParent country (alpha-2 code).
Example: US
kindstringYesSubdivision type (e.g., "state", "province", "prefecture").
Example: state
namestringYesRegion name.
Example: California
timezonestringYesPrimary IANA timezone.
Example: America/Los_Angeles

Endpoints#

Query Parameters

ParameterTypeRequiredDescription
countryquerystringNoFilter by country (alpha-2 code) - required.
Example: US
pagequeryintegerNoPage number (1-indexed).
Example: 1
per_pagequeryintegerNoNumber of results per page.
Example: 20

Response

FieldTypeRequiredDescription
dataobject[]YesThe data items for this page.
paginationobjectYes Pagination metadata in response.
pageintegerYesCurrent page number.
Example: 1
per_pageintegerYesItems per page.
Example: 20
total_itemsintegerYesTotal number of items.
Example: 100
total_pagesintegerYesTotal number of pages.
Example: 5

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/regions?country=US&page=1',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
400Missing country parameter
404Country not found
429Rate limit exceeded

Path Parameters

ParameterTypeRequiredDescription
identifierpathstringYesISO 3166-2 region code (e.g., 'US-CA', 'JP-13')

Response

FieldTypeRequiredDescription
codestringYesISO 3166-2 code (e.g., "US-CA").
Example: US-CA
code_altstringNoAlternative code where ambiguity exists.
Example: CA
countrystringYesParent country (alpha-2 code).
Example: US
kindstringYesSubdivision type (e.g., "state", "province", "prefecture").
Example: state
namestringYesRegion name.
Example: California
timezonestringYesPrimary IANA timezone.
Example: America/Los_Angeles

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/regions/example',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
404Region not found