Flight Search
POST
/api/v1/generic-api-service/flight/search
The search endpoint searches for available flights between an origin and a destination for the given dates and passengers. It returns a search context (used by subsequent steps) and a list of flights, each containing its segments, priced offers/fares and, when requested, the available fare brands.
- cURL
- Request
- Response
- Request Details
- Response Details
curl --location 'https://test-api.etscore.com/api/v1/generic-api-service/flight/search' \
--header 'Accept-Language: en-US' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"from": "AYT",
"to": "SAW",
"cityFrom": true,
"cityTo": true,
"departureDate": "2026-10-10",
"returnDate": "2026-10-30",
"passengers": {
"adults": 1,
"children": 0,
"infants": 0
},
"cabinClass": null,
"filters": {
"directOnly": false
},
"options": {
"includeFareBrands": true
}
}'
{
"from": "AYT",
"to": "SAW",
"cityFrom": true,
"cityTo": true,
"departureDate": "2026-10-10",
"returnDate": "2026-10-30",
"passengers": {
"adults": 1,
"children": 0,
"infants": 0
},
"cabinClass": null,
"filters": {
"directOnly": false
},
"options": {
"includeFareBrands": true
}
}
{
"success": true,
"search": {
"id": "500jf52h9ufu1vx2zgs2jlpfx93ja3yi6"
},
"flights": [
0: {
"id": "qg-bfc4f1f8-c3be-44e7-800d-0ace93a4c845",
"index": 0,
"packageId": 0,
"type": "UNPACK",
"stopCount": 0,
"totalFlightDurationMinutes": 80,
"totalLayoverDurationMinutes": 0,
"technicalStop": false,
"carrier": {
"validating": {
"code": "PC",
"name": "Pegasus"
}
},
"segments": [
0: {
"flight": {
"number": "2028",
"flyTimeMinutes": 80,
"layoverDurationMinutes": 0,
"numberOfStops": 0,
"stopCount": 0,
"technicalStop": false,
"fareBasis": "MKTSEG-NTExMTQ1NQ=="
},
"airline": {
"marketing": {
"code": "PC",
"name": "Pegasus"
},
"operating": {
"code": "PC",
"name": "Pegasus"
}
},
"availability": {
"minSeats": 3
},
"departure": {
"dateTime": "2026-10-13T00:10:00",
"nextDay": false,
"airport": {
"iataCode": "SAW",
"code": "SAW",
"name": "Sabiha Gokcen International Airport",
"city": "Istanbul",
"country": "Turkey",
"countryCode": "TR"
}
},
"arrival": {
"dateTime": "2026-10-13T01:30:00",
"nextDay": false,
"airport": {
"iataCode": "AYT",
"code": "AYT",
"name": "Antalya Airport",
"city": "Antalya",
"country": "Turkey",
"countryCode": "TR"
}
},
"equipment": {
},
"baggage": {
}
}
],
"offers": [
0: {
"id": "SUPER_ECO-690566;;;SVD-LTE=-LTE=",
"class": {
"code": "K",
"type": "ECONOMY"
},
"cabin": {
"classCode": "K",
"type": "ECONOMY"
},
"pricing": {
"currency": "EUR",
"fare": 121.85,
"total": 155.4,
"tax": {
"total": 33.55,
"VQ": 6.98,
"YR": 5.31,
"other": 21.26
}
},
"rules": {
"refundable": true,
"nonRefundable": false
},
"services": {
"baggageIncluded": true
},
"passengerPrices": [
0: {
"type": "ADULT",
"fareBasis": ";PAXSEG-NTExMTQ1NQ==",
"pricing": {
"currency": "EUR",
"fare": 60.92,
"total": 77.7,
"tax": {
"total": 16.78,
"VQ": 3.49,
"YR": 2.66,
"other": 10.63
}
},
"baggage": {
"pieces": 1,
"checkedKg": 15,
"cabinKg": 8
}
}
],
"metadata": {
"fareCode": "ShoppingOffer-1-...;;ShoppingOfferItem-1-Flight"
}
}
],
"fares": [
],
"brands": [
0: {
"code": "SUPER_ECO",
"name": "SUPER_ECO",
"priceDifference": 0,
"price": 0,
"currency": "EUR",
"features": {
"mealAvailable": false,
"seatSelectionFree": false,
"refundAllowed": false,
"exchangeAllowed": false,
"loungeAccess": false
},
"baggage": [
0: {
"type": "CHECKEDBAG",
"piece": 1,
"weight": 15,
"unit": "KG",
"description": "1 x 15 KG",
"onlyPiece": false,
"paxType": "ADULT"
},
1: {
"type": "HANDBAG",
"piece": 1,
"weight": 8,
"unit": "KG",
"dimension": "55x40x23",
"description": "1 x 8 KG - 55x40x23",
"onlyPiece": false,
"paxType": "ADULT"
}
],
"miles": {
"earned": 0,
"bonusPercent": false
},
"metadata": {
"providerId": "952"
}
},
1: {
"code": "COMFORT_FLEX",
"name": "COMFORT_FLEX",
"priceDifference": 54.92,
"price": 54.92,
"currency": "EUR",
"features": {
"mealAvailable": false,
"seatSelectionFree": true,
"refundAllowed": true,
"exchangeAllowed": true,
"loungeAccess": false
},
"baggage": [
],
"miles": {
"earned": 0,
"bonusPercent": false
},
"metadata": {
"providerId": "952"
}
}
]
}
]
}
| Name | Type | Required | Description |
|---|---|---|---|
| from | string | Yes | Origin IATA code (airport or city), e.g. AYT. |
| to | string | Yes | Destination IATA code (airport or city), e.g. SAW. |
| cityFrom | boolean | No | If true, treats from as a city code (includes all airports of the city). |
| cityTo | boolean | No | If true, treats to as a city code (includes all airports of the city). |
| departureDate | string | Yes | Departure date in yyyy-MM-dd format. |
| returnDate | string | No | Return date in yyyy-MM-dd format. Provide for round-trip; omit or send null for one-way. |
| passengers | object | Yes | Passenger counts by type. |
| passengers/adults | int | Yes | Number of adult passengers. |
| passengers/children | int | No | Number of child passengers. |
| passengers/infants | int | No | Number of infant passengers. |
| cabinClass | string | No | Preferred cabin class (e.g. ECONOMY). null means no preference. |
| filters | object | No | Search filters. |
| filters/directOnly | boolean | No | If true, returns only non-stop (direct) flights. |
| options | object | No | Additional response options. |
| options/includeFareBrands | boolean | No | If true, includes the available fare brands for each flight. |
| Name | Type | Required | Description |
|---|---|---|---|
| success | boolean | Yes | Indicates whether the request was processed successfully. |
| search/id | string | Yes | Unique search session identifier. Carry this value into subsequent steps (flight detail, reservation). |
| flights | object-array | Yes | List of matching flight options. |
| flights/id | string | Yes | Unique identifier of the flight option. |
| flights/index | int | Yes | Leg index the option belongs to (e.g. 0 outbound, 1 return). |
| flights/packageId | int | Yes | Package grouping identifier. |
| flights/type | string | Yes | Offer type (e.g. UNPACK). |
| flights/stopCount | int | Yes | Number of stops for the option. |
| flights/totalFlightDurationMinutes | int | Yes | Total flying time in minutes. |
| flights/totalLayoverDurationMinutes | int | Yes | Total layover time in minutes. |
| flights/technicalStop | boolean | Yes | Whether the itinerary includes a technical stop. |
| flights/carrier/validating | object | Yes | Validating carrier: code and name. |
| flights/segments | object-array | Yes | Segments of the flight option. |
| flights/segments/flight/number | string | Yes | Flight number. |
| flights/segments/flight/flyTimeMinutes | int | Yes | Flying time of the segment in minutes. |
| flights/segments/flight/layoverDurationMinutes | int | Yes | Layover after this segment in minutes. |
| flights/segments/flight/numberOfStops | int | Yes | Number of stops on the segment. |
| flights/segments/flight/technicalStop | boolean | Yes | Whether the segment has a technical stop. |
| flights/segments/flight/fareBasis | string | Yes | Fare basis code of the segment. |
| flights/segments/airline/marketing | object | Yes | Marketing airline (code, name). |
| flights/segments/airline/operating | object | Yes | Operating airline (code, name). |
| flights/segments/availability/minSeats | int | Yes | Minimum number of seats available at this price. |
| flights/segments/departure/dateTime | string | Yes | Departure local date and time. |
| flights/segments/departure/nextDay | boolean | Yes | Whether departure is on the next day relative to the itinerary. |
| flights/segments/departure/airport | object | Yes | Departure airport: iataCode, code, name, city, country, countryCode. |
| flights/segments/arrival/dateTime | string | Yes | Arrival local date and time. |
| flights/segments/arrival/nextDay | boolean | Yes | Whether arrival is on the next day. |
| flights/segments/arrival/airport | object | Yes | Arrival airport object (same shape as the departure airport). |
| flights/offers | object-array | Yes | Purchasable priced options for the flight. (fares mirrors the same structure.) |
| flights/offers/id | string | Yes | Unique offer identifier. |
| flights/offers/class | object | Yes | Booking class code (e.g. W) and type (e.g. ECONOMY). |
| flights/offers/cabin | object | Yes | Cabin class classCode and type. |
| flights/offers/pricing/currency | string | Yes | Pricing currency (e.g. EUR). |
| flights/offers/pricing/fare | decimal | Yes | Base fare amount (before taxes). |
| flights/offers/pricing/total | decimal | Yes | Total price (fare + taxes). |
| flights/offers/pricing/tax | object | Yes | Tax breakdown: total, VQ, YR, other. |
| flights/offers/rules | object | Yes | Refund rules: refundable, nonRefundable. |
| flights/offers/services/baggageIncluded | boolean | Yes | Whether checked baggage is included. |
| flights/offers/passengerPrices | object-array | Yes | Per passenger-type pricing. |
| flights/offers/passengerPrices/type | string | Yes | Passenger type (e.g. ADULT). |
| flights/offers/passengerPrices/fareBasis | string | Yes | Fare basis for the passenger type. |
| flights/offers/passengerPrices/pricing | object | Yes | Pricing block for the passenger (same shape as pricing). |
| flights/offers/passengerPrices/baggage | object | Yes | Baggage allowance: pieces, checkedKg, cabinKg. |
| flights/offers/metadata/fareCode | string | Yes | Opaque fare token used to carry this priced option into the next step. |
| flights/brands | object-array | No | Available fare brands. Returned when options.includeFareBrands is true. Brand codes and names are airline-specific. |
| flights/brands/code | string | No | Brand code (e.g. SUPER_ECO, COMFORT_FLEX). |
| flights/brands/name | string | No | Brand name. |
| flights/brands/priceDifference | decimal | No | Price difference relative to the base brand. |
| flights/brands/price | decimal | No | Additional price for this brand. |
| flights/brands/currency | string | No | Currency of the brand price. |
| flights/brands/features | object | No | Brand features: mealAvailable, seatSelectionFree, refundAllowed, exchangeAllowed, loungeAccess. |
| flights/brands/baggage | object-array | No | Baggage allowances per type (UNDERSEAT, HANDBAG, CHECKEDBAG) with piece, weight, unit, dimension, description, paxType. |
| flights/brands/miles | object | No | Miles info: earned, bonusPercent. |
| flights/brands/metadata/providerId | string | No | Provider identifier for the brand. |