Catalog/data-country-compare

Data

Country development comparison API

Pulls a curated panel of latest World Bank development indicators (GDP, GDP per capita, population, life expectancy, growth, inflation, internet, CO2) for two ISO country codes and computes per-indicator deltas, ratios, and a leader. Answers 'How do these two countries compare?', 'What is the GDP-per-capita ratio between them?', 'Which country has higher life expectancy?'.

Price$0.01per request
MethodPOST
Route/v1/data/country-compare
StatusLive
MIME typeapplication/json
Rate limit60/minute
Cache3600s public
datacountry-comparecomparisonworld-bankdevelopment-indicatorsgdpdemographicsmacro
API URLhttps://x402.hexl.dev/v1/data/country-compare
Integration docs
Example request
{
  "countryA": "JP",
  "countryB": "DE"
}
Example response
{
  "countryA": "JP",
  "countryB": "DE",
  "indicators": {
    "gdpUsd": {
      "JP": 4204940000000,
      "DE": 4456080000000,
      "year": {
        "JP": 2023,
        "DE": 2023
      },
      "delta": -251140000000,
      "ratio": 0.944,
      "leader": "DE"
    },
    "gdpPerCapitaUsd": {
      "JP": 33834.4,
      "DE": 52745.8,
      "year": {
        "JP": 2023,
        "DE": 2023
      },
      "delta": -18911.4,
      "ratio": 0.641,
      "leader": "DE"
    },
    "population": {
      "JP": 124516650,
      "DE": 84482267,
      "year": {
        "JP": 2023,
        "DE": 2023
      },
      "delta": 40034383,
      "ratio": 1.474,
      "leader": "JP"
    },
    "lifeExpectancyYears": {
      "JP": 84,
      "DE": 80.9,
      "year": {
        "JP": 2022,
        "DE": 2022
      },
      "delta": 3.1,
      "ratio": 1.038,
      "leader": "JP"
    }
  }
}
Input schema
{
  "type": "object",
  "required": [
    "countryA",
    "countryB"
  ],
  "properties": {
    "countryA": {
      "type": "string",
      "pattern": "^[A-Za-z]{2,3}$",
      "examples": [
        "JP"
      ]
    },
    "countryB": {
      "type": "string",
      "pattern": "^[A-Za-z]{2,3}$",
      "examples": [
        "DE"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}