← All datasets

City Populations Through Time

Two joinable datasets turning Wikidata's timestamped population statements into growth curves: 7,433 cities and 45,415 dated observations, because a city is not a snapshot but a SERIES. Detroit rises to 1.85 million and falls for seventy years; 1,615 cities sit past their peak; the deepest series runs 1,222 years. The pull is as exhaustive as the graph allows (every entity classed as a city, big city, megacity, million city or capital, then every dated population statement each carries, with the determination method kept as a column). One observation ships per city and date: a census beats an estimate and the larger figure breaks remaining ties, and a generational-impossibility guard drops the mis-scoped statements (a population cannot change 40-fold within 25 years) while letting genuine centuries-apart swings, ancient Rome to medieval Rome, stand. The cities file summarizes each curve: earliest, latest and peak populations with years, growth multiple, span, a declining flag, coordinates for mapping and the founding year. Join on City_ID, the Wikidata identifier, because the world holds dozens of Springfields. Built with a 16-test acceptance suite anchored on Detroit's decline and Shenzhen's climb.
52,848 rows 2 joinable files last pulled 2026-09-11
Cities 7,433 rows × 17 columns
CityCity_IDCountryLatitudeLongitudeFounded_YearObservationsEarliest_Census_YearEarliest_PopulationLatest_Census_YearLatest_PopulationPeak_PopulationPeak_YearDecliningGrowth_MultipleSpan_YearsCity_URL
Population History 45,415 rows × 7 columns
CityCity_IDCountryCensus_DateYearPopulationMethod

Questions and answers

What is the City Populations Through Time dataset?

Two joinable datasets turning Wikidata's timestamped population statements into growth curves: 7,433 cities and 45,415 dated observations, because a city is not a snapshot but a SERIES. Detroit rises to 1.85 million and falls for seventy years; 1,615 cities sit past their peak; the deepest series runs 1,222 years. The pull is as exhaustive as the graph allows (every entity classed as a city, big city, megacity, million city or capital, then every dated population statement each carries, with the determination method kept as a column). One observation ships per city and date: a census beats an estimate and the larger figure breaks remaining ties, and a generational-impossibility guard drops the mis-scoped statements (a population cannot change 40-fold within 25 years) while letting genuine centuries-apart swings, ancient Rome to medieval Rome, stand. The cities file summarizes each curve: earliest, latest and peak populations with years, growth multiple, span, a declining flag, coordinates for mapping and the founding year. Join on City_ID, the Wikidata identifier, because the world holds dozens of Springfields. Built with a 16-test acceptance suite anchored on Detroit's decline and Shenzhen's climb.

How big is the City Populations Through Time dataset?

52,848 rows across 2 joinable files, with 24 columns in total: City, City_ID, Country, Latitude, Longitude, Founded_Year, Observations, Earliest_Census_Year, Earliest_Population, Latest_Census_Year, Latest_Population, Peak_Population, Peak_Year, Declining, Growth_Multiple, Span_Years, City_URL, City, City_ID, Country, Census_Date, Year, Population, Method.

Where does the data come from?

It is built by programmatically scraping wikidata.org, last pulled on 2026-09-11. Datasets are versioned; older versions stay downloadable.

Is the dataset free to download?

Yes. Every CodeSights dataset is completely free as a CSV download; a free account is all it takes. Anyone can preview the data without signing in.

Can I see the code that built this dataset?

Yes. The exact Python scraper that built it is viewable on the dataset page by any signed-in member, so every number is reproducible.

How do the files join?

Join the files on City_ID (history.City_ID = cities.City_ID); Observations on the cities file says how many history rows to expect.

Can the data contain errors?

Automated scraping leaves room for error and the underlying sources change over time, so no version is guaranteed accurate or complete. If a number matters, verify it against the original source.

Browse every free dataset on CodeSights