/amadeus-travel-builder:city-searchfrom amadeus-travel-builder
Write 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.
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 city search by keyword into an app. A user types part of a city name - optionally scoped to a country - and your app gets back matching cities with their IATA city code and coordinates. Ask for include=AIRPORTS and each city also carries the airports that serve it.
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/cities?keyword={keyword}&countryCode={cc}&include=AIRPORTS
| Parameter | Required | Type | Constraints | Notes |
|---|---|---|---|---|
keyword | yes | string | 3-50 chars | Case-insensitive substring of the city name (e.g. PARIS, LYO). Letters and inner spaces only - no digits, hyphens, apostrophes, dots or *; a leading or trailing space matches nothing. |
countryCode | no | string | exactly 2 chars | ISO 3166 Alpha-2 (e.g. US, FR); scopes results to one country. |
max | no | integer | 1-1000 | Cap on the number of cities returned. Default and maximum 1000; out-of-range values are ignored with warning 111. |
include | no | enum | AIRPORTS | Case-sensitive. Adds relationships on each city and a top-level included.airports map. |
{
"data": [
{
"type": "location",
"subType": "city",
"name": "Paris",
"iataCode": "PAR",
"address": { "countryCode": "FR", "stateCode": "FR-75" },
"geoCode": { "latitude": 48.85341, "longitude": 2.3488 },
"relationships": [
{ "id": "BVA", "type": "Airport", "href": "#/included/airports/BVA" },
{ "id": "CDG", "type": "Airport", "href": "#/included/airports/CDG" },
{ "id": "ORY", "type": "Airport", "href": "#/included/airports/ORY" },
{ "id": "XCR", "type": "Airport", "href": "#/included/airports/XCR" }
]
}
],
"included": {
"airports": {
"BVA": { "subType": "Airport", "name": "Beauvais-Tille", "iataCode": "BVA", "address": { "countryCode": "FR", "stateCode": "FR-75" }, "geoCode": { "latitude": 49.45444, "longitude": 2.11278 } },
"CDG": { "subType": "Airport", "name": "Charles de Gaulle", "iataCode": "CDG", "address": { "countryCode": "FR", "stateCode": "FR-75" }, "geoCode": { "latitude": 49.01278, "longitude": 2.55 } },
"ORY": { "subType": "Airport", "name": "Orly", "iataCode": "ORY", "address": { "countryCode": "FR", "stateCode": "FR-75" }, "geoCode": { "latitude": 48.72528, "longitude": 2.35944 } },
"XCR": { "subType": "Airport", "name": "Chalons-Vatry", "iataCode": "XCR", "address": { "countryCode": "FR", "stateCode": "FR-75" }, "geoCode": { "latitude": 48.77611, "longitude": 4.18444 } }
}
},
"meta": { "count": 8, "links": { "self": "..." } }
}
The response to keyword=PARIS&countryCode=FR&include=AIRPORTS, trimmed to the first of its 8 cities and that city's airports.
The content type is application/vnd.amadeus+json whatever Accept you send; requesting application/json is fine.
| Field | Type | Notes |
|---|---|---|
type | string | "location". |
subType | string | "city". |
name | string | Mixed case, e.g. Paris. |
iataCode | string, optional | IATA city code, e.g. PAR. |
address.countryCode | string | ISO 3166-1 alpha-2, uppercase. |
address.stateCode | string, optional | {countryCode}-{subdivision}, e.g. FR-75, US-IL; {countryCode}-ZZZ (e.g. IT-ZZZ) in countries stored without subdivisions. |
geoCode | { latitude?, longitude? } | Floats; can be {}. |
relationships | { id, type: "Airport", href }[] | Only with include=AIRPORTS. id is the airport's key in included.airports; href is a JSON-pointer-style reference such as #/included/airports/CDG. |
| Key | Type | Notes |
|---|---|---|
included.airports | map of IATA code → { subType: "Airport", name, iataCode, address, geoCode } | Only with include=AIRPORTS. An airport's address.stateCode is that of the city it serves, not its own location - Chalons-Vatry (XCR) carries Paris's FR-75. |
meta.count | integer | Number of cities in data (at most 1000), not the total number of matches. |
meta.links.self | string | Link to the current query. |
warnings | { status, code, title, detail?, source? }[] | Optional, with HTTP 200; not a failure. 8200 means more matches exist than were returned - narrow with countryCode. |
Developer asks: "Let users search for French cities as they type." Implementation:
NIC: transliterate the input to ASCII and call GET ${AMADEUS_GATEWAY_URL}/v1/reference-data/locations/cities?keyword=NIC&countryCode=FR&max=10. Nice (NCE) comes back first, alongside towns such as Pornic and Pornichet that have no code.name plus iataCode (when present) for each result.iataCode (the IATA city code) in form state.Result: a typeahead constrained to French cities that resolves typed text into IATA city codes.
Developer asks: "When someone picks a city, let them choose which of its airports to fly from." Implementation:
GET ${AMADEUS_GATEWAY_URL}/v1/reference-data/locations/cities?keyword=PARIS&countryCode=FR&include=AIRPORTS.relationships[]; for each entry, look up included.airports[relationship.id] to get the airport's name and iataCode.BVA), Charles de Gaulle (CDG), Orly (ORY) and Chalons-Vatry (XCR) - as sub-options under the city.Result: a city → airports drill-down for a flight-origin selector.
Developer asks: "Write code that resolves a typed city name to its IATA city code." Implementation:
keyword=LYO&countryCode=FR. Lyon (LYS) comes back alongside towns such as Sainte-Foy-les-Lyon that have no code.name best matches the input rather than taking data[0], and skip records without an iataCode.iataCode from the chosen record.Result: a name → city-code resolver that skips records without a code.
relationships[].id through included.airports - treating relationships as the airport records loses name/iataCode.included.airports is one shared pool for the whole response, not per-city. When data holds several cities (which the substring match makes common), it's the union of every city's airports. Select a city's airports through its own relationships[].id - rendering the whole map under one city wrongly attributes other cities' airports to it.keyword is a substring match. It matches anywhere in the name, so PARIS returns not just Paris but Le Touquet-Paris-Plage, Villeparisis, Damparis, Parisot and others. Rank/filter by name yourself (prefer exact and word-start matches) rather than assuming data[0] is the city the user meant, and scope with countryCode to cut noise. Validate the final keyword after transliteration and word selection; send it only when it meets the 3-50-character limit, since normalization can leave a shorter fragment even when the original input is long enough.iataCode is often absent - the key is missing, not null. If you're resolving a name to a code, skip records without one. In a picker that feeds a location-based search (activities, points of interest), keep them - key the downstream request on geoCode or name when there's no iataCode, since filtering them out drops exactly the airport-less towns this API exists to return. A city can also have a non-airport transport code - Antibes returns XAT, a rail/coach code - so don't assume iataCode implies an airport.geoCode can be an empty object {} - check geoCode?.latitude before using coordinates.iataCode: XAT but empty geoCode, and another with coordinates but no iataCode. Merge records with the same name + address.countryCode into one (code from one, coordinates from the other) rather than listing duplicates or dropping one.id on records. Key them on name + address.countryCode (+ iataCode when present).keyword as ASCII. An accented keyword (Málaga) returns a 1797 DATA NOT FOUND warning at HTTP 200, not an error - transliterate (Malaga) before calling and percent-encode spaces as %20. Stored names keep their hyphens, which the keyword can't contain, so SAINT MALO finds nothing - search one word of the name (MALO) and match the full name client-side.BANGALORE finds nothing; BENGALURU returns Bengaluru (BLR).data key. The response is HTTP 200 with meta.count: 0 and the 1797 warning - read data with a default of [].include=AIRPORTS, the Antibes record with coordinates links to NCE; only its coded twin (XAT) has no relationships. A city with no links is a normal case, not an error.| HTTP | Code | Title | Typical cause |
|---|---|---|---|
| 400 | 32171 | MANDATORY DATA MISSING | keyword omitted |
| 400 | 572 | INVALID OPTION | Unknown query parameter |
| 400 | 2781 | INVALID LENGTH | keyword outside 3-50 chars, or countryCode not 2 chars |
| 400 | 477 | INVALID FORMAT | A character other than letters and spaces in keyword, or a non-numeric max |
| 400 | 4926 | INVALID DATA RECEIVED | include other than AIRPORTS |
| 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" }] }.
Cause: The keyword didn't match any substring of a known city name, or the countryCode scope excluded it.
Solution: Widen by dropping countryCode, or shorten the keyword to a cleaner fragment.
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.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./airport-city-searchWrite 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./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.