Travel

Flight Price Snapshot

/extract/json

Point-in-time price snapshot for a flight itinerary from an OTA or airline website.

Download the schematravel/flight-price-snapshot.json

flight-price-snapshot.schema

// names marked ? are optional

origin_iata:string// IATA code for the origin airport. Commonly found in: Google Flights, Kayak, Expedia, airline website.
origin_city?:string// City name for the origin airport. Commonly found in: Google Flights, airport database.
destination_iata:string// IATA code for the destination airport. Commonly found in: Google Flights, Kayak, airline website.
destination_city?:string// City name for the destination airport. Commonly found in: Google Flights, airport database.
outbound_date:string// Date of the outbound flight. Commonly found in: flight listing, booking page.
return_date?:string// Date of the return flight (for roundtrip). Commonly found in: flight listing, booking page.
trip_type:string// Type of trip. Commonly found in: search form, flight listing. One of: one_way, roundtrip, multi_city, other.
airline:string// Operating airline name. Commonly found in: flight listing, airline name in result.
flight_number?:string// Flight number. Commonly found in: flight listing, booking page.
cabin_class:string// Cabin class of the booking. Commonly found in: search form, flight listing. One of: economy, premium_economy, business, first, other.
stops:number// Number of stops (0 = nonstop). Commonly found in: flight listing, stop count indicator.
layover_airports?:string[]// IATA codes of layover airports. Commonly found in: flight details, itinerary breakdown.
total_duration_minutes?:number// Total flight duration in minutes. Commonly found in: flight listing, itinerary details.
outbound_departure?:string// Departure datetime for outbound flight. Commonly found in: flight listing, itinerary details.
outbound_arrival?:string// Arrival datetime for outbound flight. Commonly found in: flight listing, itinerary details.
price_usd:number// Total price in USD. Commonly found in: flight listing price, booking page.
price_currency?:string// Currency code for the price. Commonly found in: flight listing, currency indicator.
taxes_fees_usd?:number// Total taxes and fees in USD. Commonly found in: price breakdown, booking page.
base_fare_usd?:number// Base fare before taxes in USD. Commonly found in: price breakdown, booking page.
booking_url?:string// URL to book this flight. Commonly found in: booking link from listing.
seats_remaining?:number// Number of seats remaining at this price. Commonly found in: flight listing urgency indicator.
refundable?:boolean// Whether the ticket is refundable. Commonly found in: fare conditions, booking page.
snapshot_at:string// ISO 8601 timestamp of the price snapshot. Commonly found in: scraper metadata.
page_title?:string// Title of the source page. Tabstack auto-fills this from page metadata when left empty.
favicon?:string// Favicon URL of the source page. Tabstack auto-fills this from page metadata when left empty.

Try it live

A sample Flight Price Snapshot document, generated from the schema. Edit it, or paste a real response, and see it checked against the schema instantly. It runs in your browser, nothing is sent anywhere.

your-output.json
validation

Valid, matches Flight Price Snapshot

Every required field is present and each value matches its type. Extra fields are allowed. A field the page does not carry is not guaranteed to come back as null, so check values rather than only checking for null.

/extract/json

Copy-paste usage

The same call in TypeScript, Python, and curl. Point it at your own URL and go. The schema drives the response, so you get back the fields you asked for instead of a page to parse.

Features

  • Typed TypeScript and Python SDKs
  • One call, no parsing code and no second LLM pass
  • The same field names on every request, even when the page layout changes
flight-price-snapshot.ts
// curl -sfLO https://raw.githubusercontent.com/Mozilla-Ocho/tabstack-schemas/main/travel/flight-price-snapshot.json
import Tabstack from '@tabstack/sdk'
import schema from './flight-price-snapshot.json' with { type: 'json' }

const client = new Tabstack() // reads TABSTACK_API_KEY from the environment

try {
  const data = await client.extract.json({
    url: 'https://example.com/hotels/example-hotel',
    json_schema: schema,
    effort: 'standard', // 'min' | 'standard' | 'max'
  })

  console.log(data)
} catch (err) {
  console.error('Extraction failed:', err)
}

Ship this schema in one call.

Pass a URL, get matching JSON back. Free to start, no extraction layer to maintain.