# Turkishairlines — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search Turkish Airlines flights and airport locations, then check real-time flight status to stay updated on your travel plans. Browse available flights to find the best options for your journey, though availability searches may occasionally experience interruptions due to site protection measures.

**Category:** Travel | **Website:** [www.turkishairlines.com/](https://www.turkishairlines.com/) | **Docs:** [parse.bot/marketplace/e629fc7b-4e2e-439c-aaa2-dc127735d520/turkishairlines-com-api](https://parse.bot/marketplace/e629fc7b-4e2e-439c-aaa2-dc127735d520/turkishairlines-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-turkishairlines-com-api-e629fc7b/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_flight_status

Get the current status of a Turkish Airlines flight by flight number and date. Returns departure/arrival times, airports, aircraft type, terminals, gates, and distance. Strips 'TK' prefix automatically if provided. Returns has_flights=false when no flights operate on the given date.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Flight date in YYYY-MM-DD format. Defaults to today's date (UTC). |
| `flight_number` | string | Yes | Turkish Airlines flight number (e.g., '2', 'TK2', '188', 'TK188') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-turkishairlines-com-api-e629fc7b/get_flight_status \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","flight_number":"<string>"}'
```

### search_flights

Search for flight availability and prices between two airports. Supports one-way and round-trip searches with passenger and cabin class options. Returns legs with detailed fare breakdowns per flight option, including brand rights (baggage, reissue, refund policies). Prices are in TRY. Each leg contains multiple flight options sorted by departure time.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `adults` | integer | No | Number of adult passengers |
| `cabin_class` | string | No | Cabin class for the search. |
| `children` | integer | No | Number of child passengers |
| `departure_date` | string | Yes | Departure date in YYYY-MM-DD format |
| `destination` | string | Yes | Destination airport code (e.g., 'JFK', 'IST', 'CDG') |
| `infants` | integer | No | Number of infant passengers |
| `origin` | string | Yes | Origin airport code (e.g., 'IST', 'JFK', 'LHR') |
| `return_date` | string | No | Return date in YYYY-MM-DD format. Omit for one-way search. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-turkishairlines-com-api-e629fc7b/search_flights \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"adults":"<integer>","cabin_class":"<string>","children":"<integer>","departure_date":"<string>","destination":"<string>","infants":"<integer>","origin":"<string>","return_date":"<string>"}'
```

### search_locations

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).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search text for airport or city name (e.g., 'London', 'Istanbul', 'JFK') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-turkishairlines-com-api-e629fc7b/search_locations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
