Public dataset · Government, society and transport
NYC Citi Bike in BigQuery
The new_york_citibike dataset has 59 million Citi Bike trips in New York (7.5 GiB, last modified in 2018) and a live table of station status refreshed daily. Trip queries that read a few columns cost under 1.2 GiB; the station table is under 1 MiB.
bigquery-public-data.new_york_citibike covers New York's Citi Bike bike share system. Neither table has a description in the metadata.
citibike_trips has one row per ride: trip duration in seconds, start and stop time, start and end station names, ids and coordinates, bikeid, usertype (Subscriber or Customer), birth_year and gender. It was last modified in September 2018 and holds no later trips. citibike_stations is a station status table with capacity, bikes and docks available, rental methods and last_reported; it was last modified on the day these sizes were measured.
Tables and sizes
| Table | Rows | Size | Full scan | Layout |
|---|---|---|---|---|
citibike_tripsOne row per trip, up to 2018. | 58,937,715 | 7.5 GiB | $0.05 | None |
citibike_stationsCurrent station status and capacity. | 2,519 | 391 KiB | under $0.01 | None |
Example queries
Most popular start stations
Grouping by the station name string reads more than grouping by the integer start_station_id would.
SELECT start_station_name, COUNT(*) AS trips
FROM `bigquery-public-data.new_york_citibike.citibike_trips`
WHERE start_station_name IS NOT NULL
GROUP BY start_station_name
ORDER BY trips DESC
LIMIT 20;Trips and average duration per month
SELECT
DATE_TRUNC(DATE(starttime), MONTH) AS month,
COUNT(*) AS trips,
ROUND(AVG(tripduration) / 60, 1) AS avg_minutes
FROM `bigquery-public-data.new_york_citibike.citibike_trips`
WHERE starttime IS NOT NULL
GROUP BY month
ORDER BY month;All casual-rider trips with SELECT * (expensive)
The table is not partitioned or clustered, so SELECT * reads the full 7.5 GiB whatever the filter.
SELECT *
FROM `bigquery-public-data.new_york_citibike.citibike_trips`
WHERE usertype = 'Customer';Trips by user type and gender
Two short columns, about an eighth of the SELECT * bytes.
SELECT usertype, gender, COUNT(*) AS trips
FROM `bigquery-public-data.new_york_citibike.citibike_trips`
GROUP BY usertype, gender
ORDER BY trips DESC;Empty stations right now
Reads the small station table only.
SELECT name, capacity, num_bikes_available, num_docks_available, last_reported
FROM `bigquery-public-data.new_york_citibike.citibike_stations`
WHERE is_renting
AND num_bikes_available = 0
ORDER BY capacity DESC
LIMIT 20;Querying it cheaply
citibike_tripsis not partitioned or clustered. Every query pays for the full length of each column it reads, so name columns instead ofSELECT *.- Prefer the integer station ids over the name strings for grouping and joins; names are the heaviest columns.
- The trips table has not changed since 2018, so repeated identical queries are served from the cache at no charge.
FAQ
How much does it cost to query Citi Bike data in BigQuery?
Aggregate trip queries read 0.8 to 1.2 GiB, and a full scan reads 7.5 GiB, about $0.05 at the $6.25 per TiB on-demand list price. Everything fits in the free 1 TiB a month.
Is the NYC Citi Bike dataset free?
Yes for storage: the data sits in the bigquery-public-data project and Google pays to store it. You pay for the queries you run from your own project. On-demand, the first 1 TiB scanned each month is free, then you pay per TiB scanned (see BigQuery pricing).
Does the BigQuery Citi Bike dataset have recent trips?
No. citibike_trips was last modified in September 2018. Only citibike_stations, the station status table, is refreshed.
Related datasets
All public datasets · BigQuery cost queries · Pricing calculator
