Itinerary DBDocumentationAPI guide
API guide

Search recorded fares

Query recorded one-way fares for an exact route and date. Use observation time and source coverage to explain what each result means.

GET STARTED / 01

Make your first search

Send an exact departure date and two three-letter IATA airport codes. The endpoint reads recorded results from configured sources.

POST/api/v1/searchJSON
  1. Get a key. Obtain one from the deployment operator, or set FLIGHT_API_KEY locally.
  2. Send the request from your server. Keep the key out of browser code and set the departure date you want to query.
  3. Read the coverage. Check complete and coverage before presenting offers.
cURL · search fares
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"}'
Running locally?

Replace the base URL with http://localhost:5173.

GET STARTED / 02

Authentication

Pass your search key in the X-API-Key header for every search request.

Keep credentials on your server

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.

API / 03

Request fields

Only the route and departure date are required. Defaults apply to every omitted optional field.

FieldTypeMeaning
originRequiredStringThree-letter IATA origin code.
destinationRequiredStringThree-letter IATA destination code.
departure_dateRequiredDateExact departure date in YYYY-MM-DD format.
adultsInteger1–9 adults; defaults to 1.
cabinStringEconomy, premium economy, business, or first; defaults to economy.
currencyStringThree-letter currency code; defaults to EUR.
marketStringTwo-letter market code; defaults to DE.
max_age_minutesIntegerObservation age limit, 1–10,080 minutes; defaults to 180.
RESULTS / 04

Read a response

A successful HTTP response describes both the recorded fares and the coverage behind them.

offersRecorded fares

Price, itinerary, source, and observation time for matching offers.

coverageSource outcomes

The latest status for each configured source on this exact search.

completeCoverage check

True when every configured source has a recent ok or no_offers outcome.

observed_atPrice timing

The timestamp records when the source reported each offer.

Coverage has a defined scope

complete: true describes the configured source set for the query. It does not mean every airline was checked.

RESULTS / 05

Interpret result states

Read coverage with offers. An empty offers array alone does not establish that no flights exist.

StateWhat it means
No sources configuredNo source was checked; availability is unknown.
Not observedA source has no recent outcome for this route and date.
Stale or errorThe last observation is too old or the source failed.
PartialSome offers may be present, but coverage is incomplete.
Complete + no_offersEvery configured source reported no offers for this exact search.
DATA MODEL / 06

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.

Prices

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.

Times

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.

Booking links

A source-provided booking_url is a handoff. The fare must be checked again at checkout.

Search scope

Searches cover one-way, exact-date trips for adult passengers.

TROUBLESHOOTING / 07

Handle errors

Errors have an HTTP status and a machine-readable error.code.

HTTP / codeAction
400 · INVALID_REQUESTCorrect the JSON body, airport codes, date, or age limit.
401 · UNAUTHORIZEDCheck the server-side search key.
503 · SERVICE_NOT_CONFIGUREDAsk the deployment operator to configure the search key.
500 · INTERNAL_ERRORRetry later; the service could not complete the request.
HTTP 200 can still be incomplete

Handle complete: false as a coverage state, not an HTTP failure.

REFERENCE / 08

Continue building

Use these resources for exact schemas and source management.