Turkish Airlines APIturkishairlines.com ↗
Search Turkish Airlines flights, check real-time flight status, and look up airport/city codes via 3 structured JSON endpoints.
What is the Turkish Airlines API?
The Turkish Airlines API exposes 3 endpoints covering airport lookup, flight availability with fare breakdowns, and live flight status. Use search_locations to resolve airport codes and city names, search_flights to retrieve itinerary options with per-cabin pricing across one-way or round-trip routes, and get_flight_status to pull departure and arrival details, gate assignments, and aircraft type for any TK flight number.
curl -X GET 'https://api.parse.bot/scraper/0f9ef04a-be71-467a-8675-e23318aa7158/search_locations?query=London' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace turkishairlines-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Turkish Airlines SDK — search locations, check availability, and track flights."""
from parse_apis.turkish_airlines_api import TurkishAirlines, CabinClass, InvalidFormat
client = TurkishAirlines()
# Search for airports matching "Istanbul"
for loc in client.locations.search(query="Istanbul", limit=5):
print(loc.name, loc.code, loc.country, loc.multi_port)
# Search flight availability IST → LHR in business class
availability = client.availabilities.search(
origin="IST",
destination="LHR",
departure_date="2026-07-15",
cabin_class=CabinClass.ECONOMY,
)
for leg in availability.legs:
for flight in leg.flights:
seg = flight.segments[0]
print(seg.flight_number, seg.departure_time, seg.arrival_time, flight.sold_out)
if flight.starting_price:
print(f" From: {flight.starting_price.amount} {flight.starting_price.currency}")
# Get real-time flight status for TK2
try:
status = client.flightstatuses.lookup(flight_number="2", date="2026-06-11")
print(f"TK{status.flight_number} has_flights={status.has_flights}")
for fl in status.flights:
for seg in fl.segments:
print(seg.origin.city, "→", seg.destination.city, seg.aircraft_type, seg.distance_km)
except InvalidFormat as exc:
print(f"Invalid input: {exc}")
print("exercised: locations.search / availabilities.search / flightstatuses.lookup")
Search for airports and cities served by Turkish Airlines. Returns airport codes, city names, countries, and whether multi-port selections are available. Query matches against airport and city names. A single city may resolve to multiple ports (e.g. Istanbul → IST + SAW).
| Param | Type | Description |
|---|---|---|
| queryrequired | string | Search text for airport or city name (e.g., 'London', 'Istanbul', 'JFK') |
{
"type": "object",
"fields": {
"query": "string — the search text submitted",
"total": "integer — number of matching locations",
"locations": "array of location objects with code, name, type, city, city_code, country, country_code, region, multi_port, domestic, associated_ports"
}
}About the Turkish Airlines API
Airport and Location Search
The search_locations endpoint accepts a free-text query — a city name, airport name, or IATA code — and returns a ranked list of matching locations. Each result includes code, name, type, city, city_code, country, country_code, region, and boolean flags for domestic and multi_port. The multi_port flag indicates cities served by more than one airport, useful for disambiguating queries like "London" (LHR, LGW, LCY) before passing a code to the flight search.
Flight Availability and Fares
search_flights requires origin, destination, and departure_date (YYYY-MM-DD). Add return_date for a round-trip result. Optional adults, children, infants, and cabin_class (ECONOMY, BUSINESS, or FIRST) parameters filter the response. The returned legs array contains flight segments, pricing per passenger category, and fare_categories detailing brand rights — conditions like baggage allowance and change fees — for each available fare. This lets you compare fare families on the same flight, not just price totals.
Real-Time Flight Status
get_flight_status takes a flight_number (with or without the TK prefix, e.g. TK188 or 188) and an optional date defaulting to today UTC. The response includes a has_flights boolean, then a flights array where each segment carries scheduled and actual times, gate, terminal, aircraft type, and origin/destination airport details. The cleaned flight_number field in the response always strips the TK prefix for consistent downstream processing.
The Turkish Airlines API is a managed, monitored endpoint for turkishairlines.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when turkishairlines.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official turkishairlines.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a flight price tracker that monitors fare changes on specific Turkish Airlines routes using search_flights with fixed origin/destination pairs.
- Populate an autocomplete field for airport selection by querying search_locations as the user types a city or airport name.
- Display live departure boards for Turkish Airlines flights at a specific airport using get_flight_status with relevant flight numbers.
- Compare ECONOMY vs BUSINESS fare brand rights and baggage conditions on a given route by passing different cabin_class values to search_flights.
- Alert travelers to gate or terminal changes by polling get_flight_status for a monitored flight number on the day of travel.
- Resolve ambiguous city inputs (e.g., 'Paris' returning CDG and ORY) using the multi_port field from search_locations before initiating a fare search.
- Aggregate one-way price data across multiple departure dates for a route to identify the cheapest travel windows.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.