Continent is the top of the tree
/continent/{code}/countries lists every country on that continent in one call.
Seven codes cover the entire planet.
GET /continent/na
{ "continent": "NA", "name": "North America", "population": 609340107, "area": 24709000 }
Same code, one level down, and the whole continent's country list comes back.
GET /continent/na/countries
{
"continent": "NA",
"countries": [
{ "country": "AI", "name": "Anguilla" },
{ "country": "AG", "name": "Antigua and Barbuda" },
{ "country": "CA", "name": "Canada" },
{ "country": "CR", "name": "Costa Rica" }
]
}
Seven continent codes, every country under each one, no second lookup and no filtering a global country list yourself. Pass in NA and you get North America. Pass in OC and you get Oceania. Same shape either way.
The top of the tree
/continent filters the same country table. Every row already has a full record at /country/{code}, capital, currency, borders and all. One table, not two to keep in sync. The continent response is the entry point when you want the whole region at once.
Try it
Call /continent/{code}/countries for NA, EU, AS, AF, SA, OC, or AN. That's the whole list. There isn't an eighth.