/amadeus-travel-builder:airport-city-searchfrom amadeus-travel-builder
Write application code for a unified airport and city typeahead on the Amadeus Travel Builder APIs - keyword search across airports and cities by name or IATA code, ranked by traveller traffic, plus by-ID lookup. Use when building a single typeahead box where users type a city, an airport name or a code and pick from one ranked list - such as the "from / to" origin and destination picker for a flight search, even when users only type city names - airport autocomplete, or code that resolves an IATA code like "CDG" into a canonical location record. Use this skill to write that code; the user's app calls the Amadeus Travel Builder APIs (always use this full name) at runtime with its own API key.
Ships in amadeus-travel-builder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Build keyword search and by-ID lookup over a unified set of airports and cities - the typeahead behind most "where are you flying from / to?" pickers.
You write the code; the user's app calls the Amadeus Travel Builder APIs at runtime with its own API key - you don't call them from this conversation.
Base URL: https://api.amadeus.com; default to env vars AMADEUS_GATEWAY_URL and AMADEUS_API_KEY in generated code, unless the user's app loads them differently - either way, treat the key as a secret, keeping it out of client code and publicly served files. Authentication: send X-API-Key: <key> as a request header. When handing over the code, tell the user where to put their API key; if they don't have one yet, write out the Request API access form URL in your reply (requires accepting the terms).
GET https://api.amadeus.com/v1/reference-data/locations?subType={AIRPORT|CITY|AIRPORT,CITY}&keyword={keyword}
GET https://api.amadeus.com/v1/reference-data/locations/{locationId}
| Parameter | Required | Type | Default | Notes |
|---|---|---|---|---|
subType | yes | CSV of AIRPORT / CITY | - | AIRPORT, CITY, or AIRPORT,CITY. No default - omitting it returns 400. |
keyword | yes | string | - | Matches the start of any word in name / detailedName, or the start of an IATA code. 1-30 characters. |
countryCode | no | ISO 3166-1 alpha-2 | - | E.g. US, FR; narrows a keyword search by country. |
view | no | LIGHT | FULL | FULL | LIGHT for a label-only autocomplete (smaller payload). FULL when the pick feeds a map, groups airports under their city, or is passed to another call. |
page[limit] | no | integer | 10 | URL-encode brackets in clients that require it (page%5Blimit%5D). |
page[offset] | no | integer | 0 | |
sort | no | string | analytics.travelers.score | The only accepted value; omit it. |
| Parameter | Required | Notes |
|---|---|---|
locationId (path) | yes | The record's id from keyword search - A... for airports (ALHR = Heathrow), C... for cities (CPAR = Paris). Case-sensitive. The by-ID lookup takes no query parameters, not even view. |
Keyword search:
{
"meta": {
"count": 98,
"links": { "self": "...?subType=AIRPORT,CITY&keyword=LON&page%5Blimit%5D=2", "next": "...&page%5Boffset%5D=2&page%5Blimit%5D=2", "last": "...&page%5Boffset%5D=96&page%5Blimit%5D=2" }
},
"data": [
{ "type": "location", "subType": "CITY", "name": "LONDON", "id": "CLON", "iataCode": "LON", "...": "..." },
{
"type": "location",
"subType": "AIRPORT",
"name": "HEATHROW",
"detailedName": "LONDON/GB:HEATHROW",
"id": "ALHR",
"self": { "href": "https://api.amadeus.com/v1/reference-data/locations/ALHR", "methods": ["GET"] },
"timeZoneOffset": "+00:00",
"iataCode": "LHR",
"geoCode": { "latitude": 51.4775, "longitude": -0.46138 },
"address": {
"cityName": "LONDON",
"cityCode": "LON",
"countryName": "UNITED KINGDOM",
"countryCode": "GB",
"regionCode": "EUROP"
},
"analytics": { "travelers": { "score": 45 } }
}
]
}
The response to subType=AIRPORT,CITY&keyword=LON&page[limit]=2, the London city record trimmed.
By-ID lookup returns the same record as a single object under data, not an array.
| Field | Type | Notes |
|---|---|---|
type | "location" | Constant. |
subType | "AIRPORT" | "CITY" | |
name | string | Short name. |
detailedName | string | Display label: CITY/COUNTRY:NAME for airports (LONDON/GB:HEATHROW), CITY/COUNTRY for cities. Some countries add a state (LONGREACH/QL/AU), and an airport named after its city has no :NAME. |
id | string | Sub-type-prefixed: A... (airport) / C... (city). |
self | { href, methods } | Link to the by-ID endpoint. |
timeZoneOffset | string | E.g. +00:00; daylight saving included, so LHR is +01:00 in summer. FULL only. |
iataCode | string | 3 letters. |
geoCode | { latitude, longitude } | Numbers. FULL only. |
address.cityName | string | Equal to name for a city. |
address.cityCode | string | IATA city code. FULL only. |
address.countryName | string | |
address.countryCode | string | ISO 3166-1 alpha-2, uppercase. FULL only. |
address.stateCode | string | Optional, e.g. DC. FULL only. |
address.regionCode | string | E.g. EUROP, NAMER. FULL only. |
analytics | { travelers: { score } } | Optional - missing on many small airports and cities. FULL only. |
view=LIGHT returns id, self, type, subType, iataCode, name, detailedName and address with only cityName and countryName - type against that shape.
Developer asks: "Add an airport picker to my flight form." Implementation:
%20, not +). For a worked example, the user types Paris: call GET ${AMADEUS_GATEWAY_URL}/v1/reference-data/locations?subType=AIRPORT,CITY&keyword=Paris&view=LIGHT&page%5Blimit%5D=8, which returns Paris (CPAR) followed by Charles de Gaulle (ACDG), Orly (AORY) and Beauvais (ABVA).name (or detailedName) plus iataCode, with a subType badge (AIRPORT vs CITY).id (sub-type-prefixed, e.g. ALHR), iataCode and subType - in your form state, not just the label shown in the input.Result: a typeahead that resolves user text into IATA codes and canonical location records.
Developer asks: "Add a recent-airport view that reloads the full record for the airport a user picked last time." Implementation:
id (e.g. ALHR).GET ${AMADEUS_GATEWAY_URL}/v1/reference-data/locations/ALHR.data object; show "not found" on a 404 rather than a "bad request" error.Result: code that restores a stored selection to its full record.
Developer asks: "Let users search for German cities only." Implementation:
MUN: call with subType=CITY&countryCode=DE&keyword=MUN, which returns Munich (MUC).Result: typeahead constrained to German cities.
keyword as ASCII, with spaces as %20 in the final request to the gateway. Encoding the browser-to-backend request isn't enough if the backend rebuilds the URL. Form-style query builders (JS URLSearchParams, Python urlencode, …) write spaces as +, which is rejected - percent-encode the keyword on its own (a component-level encoder such as JS encodeURIComponent or Python quote) and append it to the URL, instead of passing it through the query builder. Also transliterate (Málaga → Malaga, Tromsø → Tromso) and replace punctuation other than - ' . with a space.countryCode narrows a search, it can't replace keyword. keyword still filters: keyword=A&countryCode=ES misses BCN.SPAIN returns Port of Spain, not Spanish airports - map the country name to its ISO code and pass it as countryCode alongside a keyword.address.cityCode, not result order. Airports can precede their city; cityCode needs view=FULL.id, not by IATA code. One IATA code can map to two records - AMAD (Barajas airport) and CMAD (Madrid city) both carry iataCode: MAD. Collapsing them by IATA code silently merges an airport and its city.iataCode and subType. Searching the label text again on submit can resolve to a different location than the one the user picked - re-searching BIRMINGHAM for a user who picked Birmingham, Alabama returns Birmingham UK's airport as the top result.CITY search returns almost only cities with a commercial airport. Destinations without airports (ski resorts, small coastal towns, rural areas - e.g. Antibes) return no results, so an empty response in a hotel or activity context may just mean the city has no airport.| HTTP | Code | Title | Typical cause |
|---|---|---|---|
| 400 | 477 | INVALID FORMAT | Malformed keyword |
| 400 | 572 | INVALID OPTION | Unknown query parameter, or any query parameter on by-ID lookup |
| 400 | 2781 | INVALID LENGTH | keyword empty or over 30 characters |
| 400 | 4926 | INVALID DATA RECEIVED | A sort other than analytics.travelers.score |
| 400 | 32171 | MANDATORY DATA MISSING | A required parameter is missing |
| 404 | 1797 | NOT FOUND | Unknown or lower-case locationId on by-ID lookup |
| 429 | - | TOO MANY REQUESTS | Rate limit for the API key exceeded |
| 500 | 141 | SYSTEM ERROR HAS OCCURRED |
All errors use the envelope { "errors": [{ "status", "code", "title", "detail", "source": { "parameter" } }] }.
Cause: Some HTTP clients don't URL-encode [ and ] in query strings.
Solution: URL-encode brackets: page[limit] → page%5Blimit%5D, page[offset] → page%5Boffset%5D.
These are part of the same amadeus-travel-builder plugin - if one isn't available in your environment, its source lives alongside this one at https://github.com/AmadeusITGroup/amadeus-travel-toolkit/tree/main/plugins/amadeus-travel-builder/skills.
origins / destinations; append + to an AIRPORT pick so the search stays on that airport - a bare airport code can also pull in nearby ones.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub amadeusitgroup/amadeus-travel-toolkit --plugin amadeus-travel-builder6 skills in this plugin
/activity-searchWrite application code that calls the Amadeus Travel Builder APIs for tours and activities - top activities at a destination, smart product recommendations filtered by traveler type, interests, price range, and similar-products, plus single-product detail lookups by productId. Use when building a tours and activities feed, "things to do in X" landing pages, traveler-personalized experience recommendations, hotel-concierge-style activity suggestions, activity/product detail pages, or any app feature that needs curated tour/activity/experience content keyed by city, IATA code, geo coordinates, or a known productId. Use this skill to write that code; the user's app calls the Amadeus Travel Builder APIs (always use this full name) at runtime with its own API key./airline-code-lookupWrite application code that calls the Amadeus Travel Builder APIs to resolve IATA (2-letter) or ICAO (3-letter) airline codes to airline business and common names, one at a time or in batches. Use when building an app that displays carrier names in flight results, an airline picker or filter, decoding of carrier codes from search responses, fare lookups, airline-code validation in a form, or batch resolution of a list of codes in one call. Use this skill to write that code; the user's app calls the Amadeus Travel Builder APIs (always use this full name) at runtime with its own API key./city-searchWrite application code that calls the Amadeus Travel Builder APIs to match a typed city keyword (optionally scoped to a country) to cities with their IATA city code, coordinates, and, on request, the airports that serve each city - including cities that have no airport of their own (e.g. Antibes, resort/rural towns). Use when building a city autocomplete or country-scoped city lookup for destination guides, hotels or activities, code that resolves a typed city name like "Paris" or "Lyon" into its coordinates for a location-based search, or a two-step city → airport picker where the user chooses a city and then one of the airports serving it. When the app needs cities regardless of airport coverage, this is the skill. Use this skill to write that code; the user's app calls the Amadeus Travel Builder APIs (always use this full name) at runtime with its own API key./flight-searchWrite application code that calls the Amadeus Travel Builder APIs to search flights, returning priced offers from multiple airlines in a single call - one-way, return, and complex multi-city / open-jaw itineraries - with booking deep links that redirect to each airline's site. Use when building a flight comparison feature, fare aggregation tooling, multi-city trip planners, a cheapest-flight search, any application that needs flight pricing aggregated across carriers, or any feature that shows flight departure/arrival times, layovers, or trip duration from a real search rather than mocked or precomputed data. Use this skill to write that code; the user's app calls the Amadeus Travel Builder APIs (always use this full name) at runtime with its own API key./nearest-airportsWrite application code that calls the Amadeus Travel Builder APIs to turn a geographic coordinate (latitude/longitude) into airports within a configurable radius (up to 500 km), ranked by relevance, distance, or traffic. Use when building a "nearest airport to me" feature, an "airports within 100 km of this hotel" lookup, a map-based airport finder, geo-aware defaults for a flight-search origin, or alternative-airport suggestions around a destination region (LHR/LGW/STN/LTN, etc.) - any app feature that starts from coordinates and needs airports, even if the user doesn't say the word "nearest". Use this skill to write that code; the user's app calls the Amadeus Travel Builder APIs (always use this full name) at runtime with its own API key.