# Log an airport's daily departures to a Google Sheet

> Every night, automatically record every departure from your chosen airport to a spreadsheet so you can track delays and on-time performance over time.

- Workflow type: code
- Services: AviationStack, Google Sheets
- Categories: Operations
- Published: 2026-07-17

## What it does

- Runs automatically every night and captures the day's departing flights from an airport you choose.
- Adds one row per flight to your spreadsheet: flight number, airline, destination, scheduled and actual departure times, status, and delay in minutes.
- Builds a growing, date-stamped history so you can spot delay trends and calculate on-time rates.
- Keeps a clean, consistent record with no summarizing, so you can chart, filter, or pivot the raw data however you like.

## What you'll need

- An AviationStack account and access key for the flight data.
- A Google account and a spreadsheet where the flights should be logged.
- The airport code you want to track, for example JFK or LHR.
- For busy hubs, a paid AviationStack plan, since the free tier is capped at roughly 100 lookups a month.

## Prompt

Every night at 11pm, log the day's flight activity for a specific airport to a Google Sheet so the team can keep a record and analyze on-time performance over time. Run this on a cron schedule (daily at 11pm, in the airport's local time zone). This is a deterministic log with no summarization, prioritization, or reasoning: one appended row per flight, every day.

First, pull today's departures from the target airport using AviationStack's Get Flights (Real-time and Historical) operation, filtered by the departure airport IATA code (the dep_iata parameter). Set the airport code as a configurable input near the top of the workflow, for example JFK. AviationStack authenticates by sending the access key as the access_key query parameter on every request, and the real-time flights endpoint is available on all plans.

For each flight in the response data array, map these fields: flight number (flight.iata, falling back to flight.number), airline (airline.name), destination (arrival.iata or arrival.airport), scheduled departure time (departure.scheduled), actual or estimated departure time (departure.actual, falling back to departure.estimated when the actual time is not yet reported), status (flight_status), and delay in minutes (departure.delay). When a value is missing, write an empty cell rather than skipping the flight, so every departure still produces exactly one row.

Then append one row per flight to the Google Sheet using the Append Values operation. Target a single tab (for example a tab named Flight Log) and include a date column so each night's flights are date-stamped for trend analysis. Keep a consistent column order: date, flight number, airline, destination, scheduled departure, actual or estimated departure, status, delay in minutes. Use the USER_ENTERED input option so times and numbers are stored as real values that can be charted and pivoted.

Handle pagination. AviationStack returns results in pages via the limit and offset parameters (default and maximum of 100 results per page below the Professional plan). If the airport is a large hub with more than 100 departures in a day, page through by increasing offset until all flights for the day are collected, then append them all. Note that the AviationStack Free plan is HTTP-only and capped at roughly 100 requests per month, so a busy hub may require a paid plan to cover the daily volume.

The result is a consistent daily record, one row per flight, that the team can use to track delay trends and on-time rates over time without any manual data entry.

## How to customize

- Track a different airport by swapping in another airport code.
- Change the nightly run time from 11pm to whatever fits your team.
- Add or remove columns, such as terminal, gate, or aircraft type.

## FAQ

### Which airports can I track?

Any airport that has a standard three-letter airport code, from small regional fields to major international hubs.

### Do I need a paid AviationStack plan?

The free plan works for small airports, but busy hubs can have hundreds of daily departures and the free tier is limited to about 100 lookups a month, so a paid plan is safer for high-traffic airports.

### Will this overwrite my existing data?

No. It adds new rows beneath your existing data every night, so your full history is preserved.

### Does it summarize or rank the flights?

No. It writes one row per flight exactly as reported, giving you a raw log you can analyze yourself.

### Can I measure on-time performance?

Yes. Each row includes the delay in minutes and the scheduled versus actual departure time, so you can calculate on-time rates and track trends over weeks or months.

Use this prompt in General Input: https://www.generalinput.com/prompts/log-an-airports-daily-departures-to-a-google-sheet