Population API
The Population API provides historical, current, and projected future population statistics about every country in the world.
From 8,616 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 286ms | 298ms | 357ms | 581ms | 1094ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/population GET
https://api.api-ninjas.com/v1/population
Get population data from given parameters. Returns a list of up to 5 country population statistics that satisfy the parameters. For more results use the offset parameter.
Parameters
At least one of the following parameters must be set: country, min_population, max_population
countryoptionalCountry name (case-insensitive) or 2-letter ISO-3166 alpha-2 code of the country. E.g.
JapanorJP.min_populationoptionalMinimum population of country.
max_populationoptionalMaximum population of country.
offsetoptionalOffset results for pagination.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
Returns an object containing:
country_nameThe name of the country.
historical_populationArray of historical population data objects, each containing the following fields:
yearThe year for which the population data is recorded.
populationTotal population count for the country in the given year.
yearly_change_percentagePercentage change in population from the previous year (can be positive or negative).
yearly_changeAbsolute change in population from the previous year (can be positive or negative).
migrantsNet number of migrants (immigrants minus emigrants) for the year.
median_ageMedian age of the population in years.
fertility_rateAverage number of children born per woman in the population.
densityPopulation density per square kilometer.
urban_population_pctPercentage of the total population living in urban areas.
urban_populationTotal number of people living in urban areas.
percentage_of_world_populationPercentage of the world's total population represented by this country.
rankWorld ranking by population size (1 being the most populous country).
population_forecastArray of projected future population data objects with the same structure as
historical_population.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/population?country=JapanHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"country_name": "Japan",
"historical_population": [
{
"year": 2024,
"population": 123753041,
"yearly_change_percentage": -0.5,
"yearly_change": -617906,
"migrants": 153357,
"median_age": 49.4,
"fertility_rate": 1.22,
"density": 339,
"urban_population_pct": 92.9,
"urban_population": 114979260,
"percentage_of_world_population": 1.52,
"rank": 12
},
{
"year": 2023,
"population": 124370947,
"yearly_change_percentage": -0.5,
"yearly_change": -626631,
"migrants": 175003,
"median_age": 49,
"fertility_rate": 1.21,
"density": 341,
"urban_population_pct": 92.7,
"urban_population": 115292289,
"percentage_of_world_population": 1.54,
"rank": 12
},
"..."
],
"population_forecast": [
{
"year": 2025,
"population": 123103479,
"yearly_change_percentage": -0.51,
"yearly_change": -640213,
"migrants": 140579,
"median_age": 49.8,
"fertility_rate": 1.23,
"density": 338,
"urban_population_pct": 93.1,
"urban_population": 114645589,
"percentage_of_world_population": 1.5,
"rank": 12
},
{
"year": 2030,
"population": 119584121,
"yearly_change_percentage": -0.58,
"yearly_change": -703872,
"migrants": 123993,
"median_age": 51.5,
"fertility_rate": 1.26,
"density": 328,
"urban_population_pct": 94.3,
"urban_population": 112710068,
"percentage_of_world_population": 1.4,
"rank": 15
},
"..."
]
}Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/population?country=United%20States" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.