Make your first search
Send an exact departure date and two three-letter IATA airport codes. The endpoint reads recorded results from configured sources.
- Get a key. Obtain one from the deployment operator, or set
FLIGHT_API_KEYlocally. - Send the request from your server. Keep the key out of browser code and set the departure date you want to query.
- Read the coverage. Check
completeandcoveragebefore presenting offers.
curl -X POST "https://itindb.dev/api/v1/search" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_SEARCH_KEY" \
-d '{"origin":"BER","destination":"BCN","departure_date":"2026-11-05"}'Replace the base URL with http://localhost:5173.
Authentication
Pass your search key in the X-API-Key header for every search request.
The search key belongs in your backend or environment configuration. Source registration and ingestion use a separate X-Ingest-Token, covered in the operator guide.
A missing or invalid key returns HTTP 401 with UNAUTHORIZED. A deployment without a configured key returns HTTP 503 with SERVICE_NOT_CONFIGURED.
Request fields
Only the route and departure date are required. Defaults apply to every omitted optional field.
| Field | Type | Meaning |
|---|---|---|
originRequired | String | Three-letter IATA origin code. |
destinationRequired | String | Three-letter IATA destination code. |
departure_dateRequired | Date | Exact departure date in YYYY-MM-DD format. |
adults | Integer | 1–9 adults; defaults to 1. |
cabin | String | Economy, premium economy, business, or first; defaults to economy. |
currency | String | Three-letter currency code; defaults to EUR. |
market | String | Two-letter market code; defaults to DE. |
max_age_minutes | Integer | Observation age limit, 1–10,080 minutes; defaults to 180. |
Read a response
A successful HTTP response describes both the recorded fares and the coverage behind them.
offersRecorded faresPrice, itinerary, source, and observation time for matching offers.
coverageSource outcomesThe latest status for each configured source on this exact search.
completeCoverage checkTrue when every configured source has a recent ok or no_offers outcome.
observed_atPrice timingThe timestamp records when the source reported each offer.
complete: true describes the configured source set for the query. It does not mean every airline was checked.
Interpret result states
Read coverage with offers. An empty offers array alone does not establish that no flights exist.
| State | What it means |
|---|---|
| No sources configured | No source was checked; availability is unknown. |
| Not observed | A source has no recent outcome for this route and date. |
| Stale or error | The last observation is too old or the source failed. |
| Partial | Some offers may be present, but coverage is incomplete. |
Complete + no_offers | Every configured source reported no offers for this exact search. |
Fare fields and limits
Each offer includes its source, observation time, total price, airline, flight numbers, departure and arrival timestamps, baggage state, and a booking URL when supplied.
total_minor uses minor currency units. For example, 12900 in EUR means €129.00. The total covers the searched adult party and mandatory taxes and fees; optional seats and baggage may cost extra.
observed_at records when the source saw an offer. API timestamps are normalized to UTC; the response does not provide airport time zones or separate local wall times.
A source-provided booking_url is a handoff. The fare must be checked again at checkout.
Searches cover one-way, exact-date trips for adult passengers.
Handle errors
Errors have an HTTP status and a machine-readable error.code.
| HTTP / code | Action |
|---|---|
400 · INVALID_REQUEST | Correct the JSON body, airport codes, date, or age limit. |
401 · UNAUTHORIZED | Check the server-side search key. |
503 · SERVICE_NOT_CONFIGURED | Ask the deployment operator to configure the search key. |
500 · INTERNAL_ERROR | Retry later; the service could not complete the request. |
Handle complete: false as a coverage state, not an HTTP failure.
Continue building
Use these resources for exact schemas and source management.