Russia is 17.1 million km². Monaco is about two. Everything in between is one sorted request away — and you don't have to keep a ranked list up to date by hand.
Biggest first
Sort the full list by area and take the top of it:
curl "https://countries.dev/countries?fields=name,area&sort=area&order=desc&limit=5"[
{ "name": "Russian Federation", "area": 17124442 },
{ "name": "Antarctica", "area": 14000000 },
{ "name": "Canada", "area": 9984670 },
{ "name": "China", "area": 9640011 },
{ "name": "United States of America", "area": 9629091 }
]Antarctica shows up at number two. It's in the data as a territory rather than a sovereign state — see below for dropping it.
Smallest countries
Flipping to order=asc is tempting, but countries with no recorded area sort to the front and muddy the result. Bound it with /area instead, which only returns countries that actually have a figure:
curl "https://countries.dev/area?max=1000&sort=area&order=asc&limit=5"[
{ "name": "Monaco", "area": 2.02 },
{ "name": "Gibraltar", "area": 6 },
{ "name": "Tokelau", "area": 12 },
{ "name": "Cocos (Keeling) Islands", "area": 14 },
{ "name": "Nauru", "area": 21 }
]A size range
/area takes min and max in square kilometres, so you can grab, say, the mid-sized countries between France and Egypt:
curl "https://countries.dev/area?min=500000&max=1100000&fields=name,area"Sovereign states only
To rank actual countries and leave out Antarctica and dependent territories, pull the sovereign list first and sort that — see sovereign countries vs. territories for the /independent endpoint that does it.
Written by
Dov Azencot
At
Thu Jun 25 2026