The Unemployment API provides historical, current, and projected future unemployment statistics about every country in the world.
https://api.api-ninjas.com/v1/unemployment
Get unemployment data for a given country. Returns historical, current and forecast unemployment statistics.
At least one of the following parameters must be set: country
, year
country
optionalCountry name (case-insensitive) or 2-letter ISO-3166 alpha-2 code of the country. E.g. Canada
or CA
.
year
optionalYear for which to retrieve unemployment data.
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/unemployment?country=Canada
Headers
X-Api-Key
Log in or sign up to get your API Key
1[
2 {
3 "country": "CAN",
4 "year": 1980,
5 "unemployment_rate": 7.5
6 },
7 {
8 "country": "CAN",
9 "year": 1981,
10 "unemployment_rate": 7.6
11 },
12 {
13 "country": "CAN",
14 "year": 1982,
15 "unemployment_rate": 11.1
16 },
17 ...
18]
1import requests
2
3api_url = 'https://api.api-ninjas.com/v1/unemployment?country=Canada'
4response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
5if response.status_code == requests.codes.ok:
6 print(response.text)
7else:
8 print("Error:", response.status_code, response.text)
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.