← Rahandus ja valuuta

Võrdle riike

GET /economics/compare/:indicator

Võrrelge a specific economic indicator across multiple countries kõrvuti. Esitage the indicator key in the URL and a komadega eraldatud list of riigikoodid as a parameter. Tagastab latest value for each country, making it easy to build comparison bar charts, ranking tables, and cross-country economic analysis tools. For example, compare GDP elaniku kohta across Norway, USA, Germany, and Estonia.

Parameetrid

indicator kohustuslik

Indicator key

countries kohustuslik

Comma-separated country codes

Näidispäringud

Põhikasutus
curl "https://nordapi.ee/api/v1/economics/compare/gdp_per_capita?countries=NO,US,DE,EE"
Compare GDP per capita across Nordic and Western countries
curl "https://nordapi.ee/api/v1/economics/compare/gdp_per_capita?countries=NO,US,DE,EE"
Compare inflation rates in G7 nations
curl "https://nordapi.ee/api/v1/economics/compare/inflation?countries=US,GB,DE,FR,JP,CA,IT"
Compare unemployment in Nordic countries
curl "https://nordapi.ee/api/v1/economics/compare/unemployment?countries=NO,SE,DK,FI"

Reaalajas vastus

{
  "data": [
    {
      "country": "NO",
      "value": 86785.4334,
      "year": 2024
    },
    {
      "country": "US",
      "value": 84534.0408,
      "year": 2024
    },
    {
      "country": "DE",
      "value": 56103.7323,
      "year": 2024
    },
    {
      "country": "EE",
      "value": 31428.3548,
      "year": 2024
    }
  ],
  "indicator": "gdp_per_capita",
  "indicator_name": "GDP per capita (current US$)",
  "success": true
}

Näidisvastus

{"success":true,"data":[{"country":"NO","value":86785.43},{"country":"US","value":84534.04}]}