Table of Contents

GET /v1/aviation/regions

Regions within a country that have airports, and the number of airports in each. A region is an ISO 3166-2 subdivision, such as a state or province. These are the values the regions filter accepts on an Airport field, and on each end of a Flight field.

Request

Query parameter Required Default Description
country Yes none The country to list regions for, as a two-character code. See GET /v1/aviation/countries for the codes.
curl "https://api.alchemy.example/v1/aviation/regions?country=gb" -H "X-Api-Key: YOUR_API_KEY"

Response

An array of { code, name, airports, scheduledAirports }, ordered by code:

[
  { "code": "GB-ENG", "name": "England", "airports": 1200, "scheduledAirports": 25 },
  { "code": "GB-SCT", "name": "Scotland", "airports": 220, "scheduledAirports": 25 }
]

The entries above are an example. Call the endpoint for current values.

Property Description
code The ISO 3166-2 code, which includes the country code, e.g. GB-ENG. This is the value the regions filter accepts.
name The region's name.
airports The number of airports in the region, of every type.
scheduledAirports The number of those airports with scheduled airline service.

Some countries have a region named (unassigned), with a code such as GB-U-A. It contains airports that are not in any region of the country. The regions filter accepts it like any other region.

Filtering with these values

A code from this list is the region of an entry in the regions property of an Airport field. Codes are matched without regard to case.

{
  "type": "Airport",
  "regions": [{ "region": "GB-SCT" }],
  "scheduledOnly": true,
  "map": { "iataCode": { "column": "code", "dataType": "Char" } }
}

Errors

400 with a ProblemDetails body:

Status When
400 country is missing, is not two characters, or has no airports.
{
  "type": "urn:alchemy:error:invalid-reference-query",
  "title": "Invalid request.",
  "status": 400,
  "detail": "country is required."
}

Requires an API key (see Authentication) but is not billed.