---
name: bts-transtats-ingestion
description: "How to get BTS TranStats data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load a TranStats monthly flight sample into Parquet

Source entry: https://signal-lab-jet.vercel.app/datasets/bts-transtats
Provider: https://www.transtats.bts.gov/
Checked against the provider's documentation: 2026-11-01

## Access
- No account or key. Monthly on-time files are public ZIP downloads containing CSV data.
- The example downloads the August 2026 file and reads its first 100,000 rows to bound memory and output size.

## Request
```bash
curl -O 'https://transtats.bts.gov/PREZIP/On_Time_Reporting_Carrier_On_Time_Performance_1987_present_2026_8.zip'
```

## Format
ZIP containing a flight-level CSV with year, month, flight date, carrier, flight number, origin, destination, scheduled and actual times, delays, cancellation, diversion and distance fields.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""TranStats August 2026 reporting-carrier on-time sample -> Parquet."""
import io
import zipfile
import requests
import pandas as pd

URL = "https://transtats.bts.gov/PREZIP/On_Time_Reporting_Carrier_On_Time_Performance_1987_present_2026_8.zip"
r = requests.get(URL, timeout=180)
r.raise_for_status()
with zipfile.ZipFile(io.BytesIO(r.content)) as z:
    csv_name = next(name for name in z.namelist() if name.lower().endswith(".csv"))
    with z.open(csv_name) as source:
        df = pd.read_csv(source, nrows=100000, low_memory=False)
df = df.loc[:, ~df.columns.str.startswith("Unnamed")]
df.to_parquet("transtats_on_time_2026_08_sample.parquet", index=False)
dates = pd.to_datetime(df["FlightDate"])
print(len(df), "flight records", dates.min().date(), "to", dates.max().date(),
      "cancelled", int(df["Cancelled"].sum()))
```
Run by us on 2026-11-01 (python 3.13.5 | pandas 3.1.0 | pyarrow 26.0.0 | requests 2.34.2). Result: 100000 flight records 2026-08-01 to 2026-08-31 cancelled 1404

## Limits
- Download rate limit: Not stated.
- Very large interactive tables can restrict all-period and all-geography downloads.
- The code reads only the first 100,000 rows of the monthly file; it is a bounded sample, not the complete month.

## Quirks
- ZIP members and table schemas vary by TranStats database; inspect the member name and columns before reuse.
- Flight times are local clock values, while FlightDate is the service date; time-zone conversion needs airport metadata.
- Carrier codes and reporting populations change after mergers or reporting-rule changes.
- The CSV commonly includes a trailing unnamed column, which the example removes.

## Terms and attribution
- TranStats provides public selective and pre-zipped downloads without a key.
- Very large requests are restricted to keep web downloads manageable.
- No separate uniform data licence was stated on the checked TranStats pages.
- Terms page: https://transtats.bts.gov/showHelp.asp

## Sources
- https://transtats.bts.gov/showHelp.asp: "TranStats is a central access point to a broad collection of intermodal transportation data."
- https://transtats.bts.gov/gettingstarted.asp: "Retrieve data in comma-delimited format from a variety of transportation data systems."
- https://transtats.bts.gov/faq.asp: "The restrictions ensure that you can download the selected data over the web within a reasonable amount of time."

## Help improve this skill
Missing a source, or see something to improve? Call the MCP tool suggest_source or feedback (or POST /api/suggest or /api/feedback). Reviewed ideas: https://signal-lab-jet.vercel.app/agent-suggestions

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
