Bearer key · query string
GET /api/v1/airports
curl -s "https://getattest.com.au/api/v1/airports?code=LHR" \
-H "authorization: Bearer $ATTEST_API_KEY"
Send the key as a bearer token in the authorization header. One key and one credit balance cover every service, including Attest Capture. A failed call is refunded automatically. No key yet? POST /api/v1/keys issues one with 25 free credits and no signup — see the key guide.
Captured 2026-09-21
Example
This request was run against the running service on 2026-09-21 and the response below is what came back, unedited.
Request JSON
{
"code": "LHR"
}
Captured response JSON
{
"call_id": "0fad4054-104a-446a-b5a4-be9e141ef268",
"query": {
"code": "LHR"
},
"found": true,
"matched_on": "iata",
"count": 1,
"airport": {
"icao": "EGLL",
"iata": "LHR",
"ident": "EGLL",
"name": "London Heathrow Airport",
"type": "large_airport",
"city": "London",
"region": "GB-ENG",
"region_name": "England",
"country": "GB",
"country_name": "United Kingdom",
"latitude": 51.470748,
"longitude": -0.459909,
"elevation_ft": 83,
"scheduled_service": true,
"home_link": "http://www.heathrow.com/",
"wikipedia_link": "https://en.wikipedia.org/wiki/Heathrow_Airport",
"keywords": [
"LON",
"Londres"
]
},
"source": "OurAirports (public domain)",
"source_url": "https://ourairports.com/data/",
"data_snapshot": "2026-09-20",
"data_age_days": 0,
"notice": "General information from a public-domain reference dataset, not an operational, navigation or flight-planning source. Airport details change: this answer reflects the OurAirports snapshot taken on the date in data_snapshot, and OurAirports publishes its data with no guarantee of accuracy or fitness for use. No timezone is returned — OurAirports does not publish one, and no licence-cleared dataset for deriving it from the coordinates is bundled here. Distances are straight-line great-circle figures between published reference points, not flown or flight-planned distances.",
"checked_at": "2026-09-20T16:55:56.641Z",
"credits_charged": 1,
"credits_remaining": 9999
}
For agents
Use when
Use this when a task needs the static facts about an airport: what an IATA or ICAO code means, where the airport is (city, region, country, coordinates, elevation), whether it has scheduled airline service, which airports a country has, or the straight-line distance and initial bearing between two of them.
8 fields
Input
Scroll the table horizontally to see all fields.
Field / Type / Required / What it does| Field | Type | Required | What it does |
|---|
code | string | Optional | One IATA (LHR) or ICAO (EGLL) code. Returns that single airport. Cannot be combined with q, country or from/to. |
|---|
q | string | Optional | Free-text search over airport, city and code. Returns a list. |
|---|
country | string | Optional | ISO 3166-1 alpha-2 country code. Returns that country's airports as a list. |
|---|
from | string | Optional | Origin IATA or ICAO code for a distance query. Must be sent with to. |
|---|
to | string | Optional | Destination IATA or ICAO code. Must be sent with from. |
|---|
type | string | Optional | Filters a q or country list by airport size. Refused on a code or from/to query, which have no list to shape. |
|---|
limit | integer | Optional | Page size for a q or country list. |
|---|
offset | integer | Optional | Rows to skip for a q or country list. |
|---|
HTTP 200
Response
Every successful response also carries call_id (your receipt for the charge), credits_charged and credits_remaining.
Scroll the table horizontally to see all fields.
Field / What it holds| Field | What it holds |
|---|
query | The parsed query echoed back, in the same words the response uses. |
|---|
found | Whether the code matched an airport (code queries). |
|---|
matched_on | Which field the code matched: iata or icao. |
|---|
airport | The matched airport: name, city, region, country, coordinates, elevation and whether it has scheduled service (code queries). |
|---|
airports | The page of matching airports (q and country queries). |
|---|
count | Rows returned in this page. |
|---|
total | Rows the query matched in total, so a caller knows whether another page exists. |
|---|
data_snapshot | The date the bundled OurAirports snapshot was taken. |
|---|
data_age_days | Whole days between data_snapshot and this call. |
|---|
notice | What this data is and is not: reference information, not an operational or flight-planning source. |
|---|
Machine-readable failures
Errors
Errors return JSON such as {"error":"invalid_api_key"}. A failed call is refunded automatically.
Scroll the table horizontally to see all fields.
Code / Status / Meaning| Code | Status | Meaning |
|---|
query_required | 400 | None of code, q, country or from/to was supplied. |
|---|
conflicting_query | 400 | More than one query form was supplied at once. |
|---|
from_required | 400 | to was sent without from. |
|---|
to_required | 400 | from was sent without to. |
|---|
invalid_q | 400 | q is shorter than the minimum search length. |
|---|
q_too_long | 400 | q is longer than the accepted length. |
|---|
invalid_country | 400 | country is not a two-letter code the dataset knows. |
|---|
invalid_type | 400 | type is not one of the airport sizes the dataset publishes. |
|---|
On every service
Scroll the table horizontally to see all fields.
Code / Status / Meaning| Code | Status | Meaning |
|---|
invalid_api_key | 401 | The authorization header is missing or the key is unknown. |
|---|
insufficient_credits | 402 | The balance is below this call's cost. The response carries credits_required and credits_remaining. |
|---|
rate_limit_exceeded | 429 | Free keys share 10 calls a minute across every service. The response carries limit and window_seconds. |
|---|
services_unavailable | 503 | The credit store could not be reached. Retry once after 30 seconds. |
|---|
Where the answer comes from
Source and scope
OurAirports (public domain) - https://ourairports.com/data/. The snapshot date is in data_snapshot on every response.
Attest reports what it read, with the source it read it from. It is general information, not advice, and not a legal record.
All Attest tools · Service list as JSON · OpenAPI