MakeMyTrip Airport Search
mmt.search.airports
Look up airports and cities by name, such as Delhi, with IATA codes, country and the airports nearby.
At a glance
- Endpoint ID
mmt.search.airports- Price
- 1 credit per call; failed calls are free
- Runs for up to
- 30 seconds
Request
Send the endpoint ID as capability and its fields as input. Set UPSCRAPE_API_KEY to your key first.
curl --request POST \ --url https://data.upscrape.com/execute \ --header "Authorization: Bearer $UPSCRAPE_API_KEY" \ --header "Content-Type: application/json" \ --header "Prefer: wait=30" \ --data '{ "capability": "mmt.search.airports", "input": { "query": "delhi" }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "mmt.search.airports", "input": { "query": "delhi" }}''')response = requests.post( "https://data.upscrape.com/execute", headers={ "Authorization": f"Bearer {os.environ['UPSCRAPE_API_KEY']}", "Content-Type": "application/json", "Prefer": "wait=30", }, json=payload,)response.raise_for_status()print(json.dumps(response.json(), indent=2))
const response = await fetch("https://data.upscrape.com/execute", { method: "POST", headers: { "Authorization": `Bearer ${process.env.UPSCRAPE_API_KEY}`, "Content-Type": "application/json", "Prefer": "wait=30", }, body: JSON.stringify({ "capability": "mmt.search.airports", "input": { "query": "delhi" }}),});if (!response.ok) { throw new Error(`Upscrape request failed: ${response.status}`);}console.log(JSON.stringify(await response.json(), null, 2));
Input
| Field | Type | Required | What it does | Example |
|---|---|---|---|---|
query |
string | yes | A city or airport name, such as delhi. | delhi |
adults |
integer | no | Leave out. | |
children |
integer | no | Leave out. | |
cursor |
string | no | Leave out. | |
max_results |
integer | no | How many matches to return. | |
page |
string | no | Leave out. | |
rooms |
integer | no | Leave out. |
Response
A finished call answers with HTTP 200; the data is in results[0].data, and billing.credits_charged is what it cost. A call still running after the wait answers 202: see jobs and results.
This is results[0].data from a real run:
{ "total_results": 9, "airports": [ { "airport_name": "Indira Gandhi International Airport", "city_name": "New Delhi", "country": "India", "country_code": "IN", "entry_type": "airport", "iata_code": "DEL", "nearby_airports": [ { "airport_name": "Hindon Airport", "city_name": "Ghaziabad", "country": "India", "country_code": "IN", "entry_type": "airport", "iata_code": "HDO" }, { "airport_name": "Noida International Airport", "city_name": "Noida", "country": "India", "country_code": "IN", "entry_type": "airport", "iata_code": "DXN" } ] }, { "airport_name": "Jaipur Airport", "city_name": "Jaipur", "country": "India", "country_code": "IN", "entry_type": "airport", "iata_code": "JAI" } ]}
Fields
| Field | Type | What it is | Example |
|---|---|---|---|
airports[].airport_name |
string | The airport's name. | Indira Gandhi International Airport |
airports[].city_name |
string | The city it serves. | New Delhi |
airports[].iata_code |
string | The airport's three-letter code. | DEL |
airports[].country |
string | The country. | India |
airports[].entry_type |
string | Whether the entry is an airport or a city. | airport |
airports[].country_code |
string | The two-letter country code. | IN |
airports[].nearby_airports |
array | Other airports near it. | 3 records |
airports[].nearby_airports[].airport_name |
string | The nearby airport's name. | Hindon Airport |
airports[].nearby_airports[].city_name |
string | The city the nearby airport serves. | Ghaziabad |
airports[].nearby_airports[].country |
string | The nearby airport's country. | India |
airports[].nearby_airports[].country_code |
string | The two-letter country code. | IN |
airports[].nearby_airports[].entry_type |
string | Whether the entry is an airport or a city. | airport |
airports[].nearby_airports[].iata_code |
string | The nearby airport's three-letter code. | HDO |
airports |
array | The airports found. | 9 records |
total_results |
integer | How many airports were found. | 9 |
If a call fails
A failed call costs nothing. The response carries an error.code you can branch on; Errors and retries lists every code and which ones to retry.
Other MakeMyTrip endpoints
Something missing or unclear? Ask the team that builds the MakeMyTrip endpoints.