Country population data from an API

Get a country's population, rank countries by size, or filter to "over 100 million" — in one request, no API key, no scraping a Wikipedia table.

Back

You need population numbers — for a chart, a ranking, a "largest markets" filter. The usual move is scraping a Wikipedia table. Here's the request instead.

One country

curl https://countries.dev/alpha/NG

You get population, and a derived populationDensity (people per km²) alongside it.

Ranked

Sort the full list and keep two fields:

curl "https://countries.dev/countries?fields=name,population&sort=population&order=desc"

China and India come out on top, as you'd expect.

Filtered by size

There's a range endpoint for "countries above N" or "between N and M":

curl "https://countries.dev/population?min=100000000&fields=name,population&sort=population&order=desc"

That's the fourteen countries over 100 million, biggest first.

One thing to be clear about: these are reference-dataset figures — a stable snapshot, not a live feed off the latest census. Great for dropdowns, rankings, and rough sizing; not the source of truth for a demographics paper.

Country data docs →

Written by

Dov Azencot

At

Tue Jun 23 2026