← Agent Data Hub · Search endpoints · /llms.txt

Population of a City in a Past Year (Wikidata, with source)

Population of a city in a given year as counted or estimated by the census or statistics office Wikidata cites, for about 5,800 cities and 37,000 city-years, from the 19th century or earlier where held; without a year the newest value and the years held. No interpolation: a year without a value gives the nearest held values.

Call it (no API key)

GET https://api.agentdatahub.de/api/v1/call/city-population-history?city=Munich&year=1900&compact=1

Full metadata: verbose=1 · Markdown: format=llm · Only some fields: add &fields=a,b.c · MCP: tool call_api with {"apiId":"city-population-history"}

How to fetch it

curl:

curl -s 'https://api.agentdatahub.de/api/v1/call/city-population-history?city=Munich&year=1900&compact=1'

Python (standard library only):

import json, urllib.request

url = "https://api.agentdatahub.de/api/v1/call/city-population-history?city=Munich&year=1900&compact=1"
with urllib.request.urlopen(url, timeout=30) as r:
    data = json.load(r)
print(json.dumps(data, indent=2)[:2000])

Google Sheets:

=IMPORTDATA("https://api.agentdatahub.de/api/v1/history/city-population-history?city=Munich&year=1900&_order=desc&_limit=500&format=csv")

The recorded history of this call as CSV, newest first. Excel: Data → From Web with the same address.

Parameters

cityCity name or Wikidata id, e.g. Munich or Q1726
yearOptional year, e.g. 1900 (default: newest)

Example response (live, compact)

{
  "apiId": "city-population-history",
  "trust": "checked",
  "data_freshness": "live",
  "data": {
    "city": "Munich",
    "country": "Germany",
    "wikidata": "Q1726",
    "year": 1900,
    "population": null,
    "no_value_for_year": "Wikidata holds no referenced population of Munich for 1900; the nearest held values follow (not interpolated).",
    "nearest": [
      {
        "date": "1867",
        "population": 167000,
        "reference": {
          "name": "Topographisch-statistisches Handbuch des Königreichs Bayern nebst alphabetischem Ortslexikon.",
          "url": null
        }
      },
      {
        "date": "1925-06-16",
        "population": 680704,
        "reference": {
          "name": "Ortschaften-Verzeichnis für den Freistaat Bayern",
          "url": null
        }
      }
    ],
    "page": "https://api.agentdatahub.de/city-population/munich",
    "trust_level": "community source (Wikidata, edited by volunteers), not official: each value as stated with the reference Wikidata cites for it",
    "source": "Wikidata, population (P1082) with point in time (P585)",
    "licence": "CC0 1.0 (Wikidata structured data)",
    "source_url": "https://www.wikidata.org/wiki/Q1726",
    "checked": "2026-12-03",
    "as_of": "1867"
  },
  "source": "Wikidata, population (P1082) with point in time, community-edited, citing censuses and statistics offices",
  "source_url": "https://www.wikidata.org/",
  "license": "CC0 1.0 (Wikidata structured data)",
  "licence_status": "green",
  "as_of": "1867",
  "checked": "2026-12-04",
  "latest_note": "Newest value the publisher held at our last load (2026-12-04); nothing newer published yet."
}

Recorded history available: /api/v1/history/city-population-history?city=Munich&year=1900

Source & license

SourceWikidata, population (P1082) with point in time, community-edited, citing censuses and statistics offices
LicenseCC0 1.0 (Wikidata structured data)
Source URLhttps://www.wikidata.org/
Termshttps://www.wikidata.org/wiki/Wikidata:Licensing
CategoryKnowledge, Research & News › Wikidata facts (community source) · more: countries-by-continent · country-facts · country-practical-facts