# Apify Flight Price API

> Collect current airfares by route with a flight price api built on the Apify Google Flights Actor (johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search). Give routes and dates and get structured fare rows back, price, currency, airlines, stops, duration, plus route-level price insights (lowest price, price level, typical price range), ready to export, compare across dates, or poll on a schedule for price monitoring. Use when the user wants a flight price api, airfare data by API, to compare fares across dates or airports, to build a flight price dataset, or to watch a route's fares over time. Current quotes only, honestly framed, no fare forecasts and no reservations. Pay-per-page billing, MCP-ready for Claude and other AI agents.

- Skill: `johnisanerd/apify-flight-price-api` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add johnisanerd/apify-flight-price-api`
- Raw SKILL.md: https://api.skillmd.com/api/skills/johnisanerd/apify-flight-price-api/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: MIT
- Author: johnisanerd (https://skillmd.com/u/johnisanerd)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/johnisanerd/apify-flight-price-api

---


# Flight Price API: Current Airfares by Route

Collect current airfares as structured data. One call takes a route and date and returns fare rows with price, airlines, stops, and duration, plus route-level price insights. Compare fares across dates or airports, export a dataset, or poll a route on a schedule.

## When to use this skill

- The user wants a "flight price API" or airfare data by API.
- They want to compare fares across dates, airports, or airlines for a trip or an analysis.
- They want a flight price dataset for a report or app, exported as JSON or CSV.
- They want to watch a route's fares over time (bounded scheduled polls).

Not for: fare forecasts or "will prices drop" predictions (the Actor reports current levels, not the future), consumer price alerts (Google and the OTAs own that), live flight status, or booking tickets.

## What you get (one dataset item per page, fares nested in `all_flights`)

Each dataset item is one page of results holding an `all_flights` array (about 30 fares per page). Per flight: `price`, `currency`, `route`, `airlines`, `departure_airport`, `departure_time`, `arrival_airport`, `arrival_time`, `stops`, `stops_label`, `duration_minutes`, `travel_class`, `flight_numbers`, `carbon_emissions_g`. Route-level context on the same item: `price_insights` with `lowest_price`, `price_level` (low, typical, high), `typical_price_range`, and a recent `price_history` series when Google shows one.

## Prerequisites

- Apify account (sign up at https://apify.com?fpr=9n7kx3&fp_sid=skillrepo).
- Authentication via `apify login`, or an `APIFY_TOKEN` environment variable (Apify Console, Settings, Integrations).

## The Actor

- Store page: https://apify.com/johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search?fpr=9n7kx3&fp_sid=skillrepo
- Actor ID: `johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search`
- Pricing: a small per-run setup fee plus a per-page fee (see `references/gotchas.md`).

## Run it with the Apify CLI

Price check for one route and date:

```bash
apify actors call "johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search" -i '{"departure_id":"ORD","arrival_id":"MIA","outbound_date":"2026-09-05","max_pages":1}' \
  --json \
  --user-agent apify-awesome-skills/apify-flight-price-api \
  2>/dev/null
```

Nonstop fares under a cap, in euros for the German market:

```bash
apify actors call "johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search" -i '{"departure_id":"FRA","arrival_id":"BCN","outbound_date":"2026-08-22","max_stops":0,"max_price":250,"currency":"EUR","gl":"de","hl":"de"}' \
  --json \
  --user-agent apify-awesome-skills/apify-flight-price-api \
  2>/dev/null
```

Every call carries the three flags this repo expects: `--json`, `--user-agent apify-awesome-skills/apify-flight-price-api`, and `2>/dev/null`.

## Run it from Claude or another AI agent (MCP)

The Actor is MCP-ready. Add the hosted server URL:

`https://mcp.apify.com/?tools=actors,docs,johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search`

Then ask, for example: "Check current fares from Chicago to Miami for the first week of September and tell me whether prices are low or high for the route." MCP setup docs: https://docs.apify.com/platform/integrations/mcp

## Workflow

1. Define the fare question. One route and date per call: `departure_id`, `arrival_id`, `outbound_date` (plus `return_date` for round-trip pricing). For a date comparison, loop the same route over several dates; for an airport comparison, use comma-separated codes.
2. Keep each call bounded. `max_pages` 1 covers the visible result set for most routes and keeps the per-call cost at a few cents.
3. Estimate cost per call and, for monitoring, per month; confirm with the user. See `references/gotchas.md`.
4. Run and read the dataset. Read the page item's `all_flights` array and sort by `price`; read `price_insights.price_level` and `typical_price_range` to say whether current fares are low, typical, or high for the route.
5. Deliver or persist. Hand back a table or CSV, or write rows to a store keyed by route plus date plus crawl time so repeated polls build a fare log over time.
6. For recurring monitoring, wrap the same input in an Apify Schedule (one schedule per route) rather than one giant multi-route run.

## Inputs

- `departure_id` / `arrival_id` (IATA codes, comma-separated allowed) and `outbound_date`; `return_date` optional
- `currency` (default USD), `gl` and `hl` (market localization)
- `max_price`, `max_stops`, `airlines`, `exclude_basic` (fare filters)
- `max_pages` (default 1): the per-call cost bound

## Cost

A one-page fare check costs a few cents (setup plus one page). A daily poll on one route is roughly a dollar a month; a 20-route daily board is roughly $20 a month, which crosses the confirm threshold. Live prices and math are in `references/gotchas.md`.

## Honest limits

- Prices are current quotes at crawl time; they change constantly and are not guaranteed at booking.
- `price_insights` is present-tense context: price level, typical range, and sometimes a recent `price_history` series from Google. It is NOT a forecast; longer or custom fare logs come from your own repeated polls.
- Monitoring freshness equals your poll interval; this is a polled source, not a push alert feed.
- No reservations and no ticketing; booking happens on the airline or travel site.

## Troubleshooting

- No `price_insights` on a route: Google does not show insights for every route and date; the fare rows still return.
- Fares jump between polls: normal airline repricing; log crawl time with every row.
- Wrong currency: set `currency` and `gl` together for the market you want.

See `references/gotchas.md` for cost guardrails and error recovery, and `references/actor-index.md` for the Actor routing table.

## Related travel Actors

- Google Hotels Search Scraper: https://apify.com/johnvc/google-hotels-search-scraper?fpr=9n7kx3&fp_sid=skillrepo
- Google Travel Explore API: https://apify.com/johnvc/google-travel-explore-api?fpr=9n7kx3&fp_sid=skillrepo
- Google Maps Directions API: https://apify.com/johnvc/google-maps-directions-api?fpr=9n7kx3&fp_sid=skillrepo

