Track airfare prices on a route with Google Flights data
Get flight options for a route and dates as JSON: airlines, times, stops, duration and price. Run it on a schedule to track fares and catch drops.
Fares on a route move daily, and checking by hand means opening the same search every morning and hoping you remember last week's number. If you run a travel desk, a deal alert or your own trip planning, you need the price history, not one snapshot. Lovely Router searches Google Flights for you. Send routes and dates, get flight options as JSON, pay per search from a prepaid balance. Call it from a cron job, a notebook or an AI agent with one API key.
Hand it to your AI agent
Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.
Track airfare prices on a route with Google Flights data. Use the Lovely Router data tools: each returns JSON and is billed per result.
- Docs (read first): https://lovelyrouter.com/docs/tools/find.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.
My task: <the inputs (links, keywords or accounts) and how many results you need>How it works
List the routes and dates
Write each search as origin and destination airport codes (IATA) plus the departure date, and a return date for a round trip. Leave the return date out for one way.
Run the tool
Send the searches to
POST /v1/tools/google-flights/runwithmax_results. The run holds its maximum cost from your balance and returns the flight options as JSON.Log the lowest fare
Store the cheapest option per route and date with a timestamp. Compare with earlier runs, and alert when the price falls below your target.
Get flight prices with one request
Search Google Flights takes a list of searches in searches. One search is one route and date pair, and one run covers up to 50:
curl https://lovelyrouter.com/v1/tools/google-flights/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{
"input": {
"searches": [{"origin": "LAX", "destination": "JFK", "departureDate": "2026-11-04", "returnDate": "2026-11-09"}]
},
"max_results": 1
}'A run still going after 60 seconds returns 202; Run a tool shows how to poll. Optional inputs narrow the search: adults, currency, maxStops, airlines and cabinClass.
What each search returns
| Field group | What you get |
|---|---|
| Airlines | The airline for each flight option |
| Times | Departure and arrival times |
| Stops | The number of stops |
| Duration | Total travel time |
| Price | The fare, in the currency you ask for |
The currency code you pass in currency is used for the returned prices. Without a valid one, prices come back in USD.
Recipes
Run the same search every morning and write the cheapest price to a sheet. After three weeks you can see whether the fare rises or falls as the date approaches.
Send the same route with a week of departure dates in one run, pick the cheapest day, and message yourself when it drops below your target.
Run a route twice, with maxStops set differently, and see what a nonstop costs over a one-stop option.
Set adults to the group size and compare a few airlines using the airlines filter, so the travel desk gets one table for a quote.
Search the same dates with different cabinClass values to show a manager what an upgrade costs on the routes your team flies most.
Prefer plain words? Connect the MCP server and tell Claude Code or Cursor: "Search flights from LAX to JFK for each Friday in November, return on Tuesday, and give me the cheapest option per week. Set max_results to 5."
Pair it with other travel data
A flight price is half of a trip budget. Hotels and local demand fill in the rest:
Flight options and prices from Google Flights for a route and dates: airlines, times, stops, duration, price.
Hotels on Booking.com for a destination (and dates): name, price for the stay, review score, stars, address, free cancellation.
Tripadvisor hotels, restaurants and attractions for a location.
Google Trends interest over time and by region for a keyword.
Airbnb listings for a place and dates: price for the stay and per night, rating, reviews, host, amenities, house rules, photos.
booking-hotelslists Booking.com hotels for a destination, with the price for the stay and review score.tripadvisor-placesfinds hotels, restaurants and attractions at the destination.google-trendsshows search interest over time for a destination, which hints at peak season.airbnb-listingscovers rentals when a hotel is not the plan.
For more on travel data, see travel and real estate data.
What you pay
You pay per search: starting a run holds its maximum cost, the per-call fee plus the per-search fee times max_results, and the run settles to what it returned. The rest of the hold goes back to your balance. A run that fails or times out pays only for the searches it delivered, and a run refused at the start costs nothing.
Tracking 10 routes daily is billed as 10 searches a day. There is no subscription and no monthly minimum: top up from $5, and one balance pays for tools and models. The card above shows today's price; pricing lists every tool.
Frequently asked questions
How do I search a one-way flight?+
Leave returnDate out of the search. Include it for a round trip.
What format do airports and dates use?+
Airports are IATA codes such as LAX and JFK. Dates are written YYYY-MM-DD.
Can I get prices in euros?+
Pass a three-letter code in currency, for example EUR, and the returned prices use it. A malformed value falls back to USD.
How many searches can one run take?+
Up to 50 searches per run. For a bigger watch list, start several runs.
Can I filter by airline or number of stops?+
Yes. airlines takes airline IATA codes or alliance names, and maxStops sets the maximum number of stops. cabinClass and adults are also available.
Do I need a subscription?+
No. You add credit to a prepaid balance and each run draws it down. Failed runs pay only for the results they delivered, and nothing renews automatically.
Planning more than flights? See travel and real estate data, and the rest of the tool catalog.