{"openapi":"3.1.0","info":{"title":"Country Statistics API","version":"1.0.0","description":"Geographic, demographic and political statistics for every country as an API — the reference a research dashboard, data-journalism piece or analytics tool needs. For each country: its government type, whether it is landlocked, surface area (km²), population, population density (people/km²) and life expectancy (years), enriched with the ISO 3166-1 alpha-2 code and flag emoji. Look a country up by name or code, or RANK every country by any numeric statistic — the ten largest by area, the most densely populated, the highest life expectancy — in ascending or descending order. Search by name or government type, or list them all. This is the country statistics reference — distinct from countries-api (ISO identifiers: codes, dialing, currency, region) and disease-api (public-health data). Served from memory — always fast.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/countrystats-api","description":"oanor gateway"}],"tags":[{"name":"Lookup"},{"name":"Rank"},{"name":"Search"},{"name":"List"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/country":{"get":{"operationId":"get_v1_country","tags":["Lookup"],"summary":"All statistics for a country","description":"","parameters":[{"name":"country","in":"query","required":false,"description":"Country name","schema":{"type":"string"},"example":"Germany"},{"name":"code","in":"query","required":false,"description":"ISO 3166-1 alpha-2 code","schema":{"type":"string"},"example":"de"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"country":{"code":"DE","emoji":"🇩🇪","country":"Germany","area_km2":357022,"government":"Federal Republic","landlocked":false,"population":82905782,"life_expectancy":77.4,"population_density":237.4}},"meta":{"timestamp":"2026-06-08T18:25:08.432Z","request_id":"ebe015b1-cecf-4524-ad2a-01f187bd372b"},"status":"ok","message":"Country statistics retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/rank":{"get":{"operationId":"get_v1_rank","tags":["Rank"],"summary":"Rank countries by a numeric metric","description":"","parameters":[{"name":"by","in":"query","required":true,"description":"population, area_km2, population_density or life_expectancy","schema":{"type":"string"},"example":"population"},{"name":"order","in":"query","required":false,"description":"desc or asc","schema":{"type":"string"},"example":"desc"},{"name":"limit","in":"query","required":false,"description":"How many (1-250)","schema":{"type":"string"},"example":"10"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":10,"order":"desc","metric":"population","ranking":[{"code":"CN","rank":1,"emoji":"🇨🇳","value":1392730000,"country":"China","area_km2":9572900,"government":"People's Republic","landlocked":false,"population":1392730000,"life_expectancy":71.4,"population_density":148.3},{"code":"IN","rank":2,"emoji":"🇮🇳","value":1352617328,"country":"India","area_km2":3287263,"government":"Federal Republic","landlocked":false,"population":1352617328,"life_expectancy":62.5,"population_density":454.9},{"code":"US","rank":3,"emoji":"🇺🇸","value":326687501,"country":"United States","area_km2":9363520,"government":"Federal Republic","landlocked":false,"population":326687501,"life_expectancy":77.1,"population_density":35.8},{"code":"ID","rank":4,"emoji":"🇮🇩","value":267663435,"country":"Indonesia","area_km2":1904569,"government":"Republic","landlocked":false,"population":267663435,"life_expectancy":70.1,"population_density":147.8},{"code":"PK","rank":5,"emoji":"🇵🇰","value":212215030,"country":"Pakistan","area_km2":796095,"government":"Republic","landlocked":false,"population":212215030,"life_expectancy":61.1,"population_density":275.3},{"code":"BR","rank":6,"emoji":"🇧🇷","value":209469333,"country":"Brazil","area_km2":8547403,"government":"Federal Republic","landlocked":false,"population":209469333,"life_expectancy":62.9,"population_density":25.1},{"code":"NG","rank":7,"emoji":"🇳🇬","value":195874740,"country":"Nigeria","area_km2":923768,"government":"Federal Republic","landlocked":false,"population":195874740,"life_expectancy":51.6,"population_density":215.1},{"code":"BD","rank":8,"emoji":"🇧🇩","value":161356039,"country":"Bangladesh","area_km2":143998,"government":"Republic","landlocked":false,"population":161356039,"life_expectancy":60.2,"population_density":1239.6},{"code":"RU","rank":9,"emoji":"🇷🇺","value":144478050,"country":"Russia","area_km2":17075400,"government":"Federal Republic","landlocked":false,"population":144478050,"life_expectancy":67.2,"population_density":8.8},{"code":"JP","rank":10,"emoji":"🇯🇵","value":126529100,"country":"Japan","area_km2":377829,"government":"Constitutional Monarchy","landlocked":false,"population":126529100,"life_expectancy":80.7,"population_density":347.1}]},"meta":{"timestamp":"2026-06-08T18:25:08.522Z","request_id":"065dd0a4-d6ce-410c-afad-b886efa00f6d"},"status":"ok","message":"Ranking retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/search":{"get":{"operationId":"get_v1_search","tags":["Search"],"summary":"Search by name or government type","description":"","parameters":[{"name":"q","in":"query","required":true,"description":"Search query (min 2 chars)","schema":{"type":"string"},"example":"republic"},{"name":"limit","in":"query","required":false,"description":"Max results (1-100)","schema":{"type":"string"},"example":"25"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":25,"query":"republic","total":146,"countries":[{"code":"AL","emoji":"🇦🇱","country":"Albania","area_km2":28748,"government":"Republic","landlocked":false,"population":2866376,"life_expectancy":71.6,"population_density":104.6},{"code":"DZ","emoji":"🇩🇿","country":"Algeria","area_km2":2381741,"government":"Republic","landlocked":false,"population":42228429,"life_expectancy":69.7,"population_density":17.7},{"code":"AO","emoji":"🇦🇴","country":"Angola","area_km2":1246700,"government":"Republic","landlocked":false,"population":30809762,"life_expectancy":38.3,"population_density":24.7},{"code":"AR","emoji":"🇦🇷","country":"Argentina","area_km2":2780400,"government":"Federal Republic","landlocked":false,"population":44494502,"life_expectancy":75.1,"population_density":16.3},{"code":"AM","emoji":"🇦🇲","country":"Armenia","area_km2":29800,"government":"Republic","landlocked":true,"population":2951776,"life_expectancy":66.4,"population_density":103.7},{"code":"AT","emoji":"🇦🇹","country":"Austria","area_km2":83859,"government":"Federal Republic","landlocked":true,"population":8840521,"life_expectancy":77.7,"population_density":107.2},{"code":"AZ","emoji":"🇦🇿","country":"Azerbaijan","area_km2":86600,"government":"Federal Republic","landlocked":true,"population":9939800,"life_expectancy":62.9,"population_density":120.3},{"code":"BD","emoji":"🇧🇩","country":"Bangladesh","area_km2":143998,"government":"Republic","landlocked":false,"population":161356039,"life_expectancy":60.2,"population_density":1239.6},{"code":"BB","emoji":"🇧🇧","country":"Barbados","area_km2":430,"government":"Republic","landlocked":false,"population":286641,"life_expectancy":73,"population_density":666.6},{"code":"BY","emoji":"🇧🇾","country":"Belarus","area_km2":207600,"government":"Republic","landlocked":true,"population":9483499,"life_expectancy":68,"population_density":46.7},{"code":"BJ","emoji":"🇧🇯","country":"Benin","area_km2":112622,"government":"Republic","landlocked":false,"population":11485048,"life_expectancy":50.2,"population_density":101.9},{"code":"BO","emoji":"🇧🇴","country":"Bolivia","area_km2":1098581,"government":"Republic","landlocked":true,"population":11353142,"life_expectancy":63.7,"population_density":10.5},{"code":"BA","emoji":"🇧🇦","country":"Bosnia and Herzegovina","area_km2":51197,"government":"Federal Republic","landlocked":false,"population":3323929,"life_expectancy":71.5,"population_density":64.9},{"code":"BW","emoji":"🇧🇼","country":"Botswana","area_km2":581730,"government":"Republic","landlocked":true,"population":2254126,"life_expectancy":39.3,"population_density":4},{"code":"BR","emoji":"🇧🇷","country":"Brazil","area_km2":8547403,"government":"Federal Republic","landlocked":false,"population":209469333,"life_expectancy":62.9,"population_density":25.1},{"code":"BG","emoji":"🇧🇬","country":"Bulgaria","area_km2":110994,"government":"Republic","landlocked":false,"population":7025037,"life_expectancy":70.9,"population_density":64.7},{"code":"BF","emoji":"🇧🇫","country":"Burkina Faso","area_km2":274000,"government":"Republic","landlocked":true,"population":19751535,"life_expectancy":46.7,"population_density":72.2},{"code":"BI","emoji":"🇧🇮","country":"Burundi","area_km2":27834,"government":"Republic","landlocked":true,"population":11175378,"life_expectancy":46.2,"population_density":435.2},{"code":"CM","emoji":"🇨🇲","country":"Cameroon","area_km2":475442,"government":"Republic","landlocked":false,"population":25216237,"life_expectancy":54.8,"population_density":53.3},{"code":"CV","emoji":"🇨🇻","country":"Cape Verde","area_km2":4033,"government":"Republic","landlocked":false,"life_expectancy":68.9,"population_density":134.9},{"code":"CF","emoji":"🇨🇫","country":"Central African Republic","area_km2":622984,"government":"Republic","landlocked":true,"population":4666377,"life_expectancy":44,"population_density":7.5},{"code":"TD","emoji":"🇹🇩","country":"Chad","area_km2":1284000,"government":"Republic","landlocked":true,"population":15477751,"life_expectancy":50.5,"population_density":12.3},{"code":"CL","emoji":"🇨🇱","country":"Chile","area_km2":756626,"government":"Republic","landlocked":false,"population":18729160,"life_expectancy":75.7,"population_density":25.2},{"code":"CN","emoji":"🇨🇳","country":"China","area_km2":9572900,"government":"People's Republic","landlocked":false,"population":1392730000,"life_expectancy":71.4,"population_density":148.3},{"code":"CO","emoji":"🇨🇴","country":"Colombia","area_km2":1138914,"government":"Republic","landlocked":false,"population":49648685,"life_expectancy":70.3,"population_density":44.7}]},"meta":{"timestamp":"2026-06-08T18:25:08.621Z","request_id":"496427fd-1b6b-4093-886f-d9f4188f8f60"},"status":"ok","message":"Search results retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/list":{"get":{"operationId":"get_v1_list","tags":["List"],"summary":"List countries","description":"","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size (1-300)","schema":{"type":"string"},"example":"50"},{"name":"offset","in":"query","required":false,"description":"Offset","schema":{"type":"string"},"example":"0"},{"name":"landlocked","in":"query","required":false,"description":"Filter landlocked countries","schema":{"type":"string"},"example":"true"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":43,"total":43,"countries":[{"code":"AF","emoji":"🇦🇫","country":"Afghanistan","area_km2":652090,"government":"Islamic Emirate","landlocked":true,"population":37172386,"life_expectancy":45.9,"population_density":56.9},{"code":"AD","emoji":"🇦🇩","country":"Andorra","area_km2":468,"government":"Parliamentary Coprincipality","landlocked":true,"population":77006,"life_expectancy":83.5,"population_density":163.8},{"code":"AM","emoji":"🇦🇲","country":"Armenia","area_km2":29800,"government":"Republic","landlocked":true,"population":2951776,"life_expectancy":66.4,"population_density":103.7},{"code":"AT","emoji":"🇦🇹","country":"Austria","area_km2":83859,"government":"Federal Republic","landlocked":true,"population":8840521,"life_expectancy":77.7,"population_density":107.2},{"code":"AZ","emoji":"🇦🇿","country":"Azerbaijan","area_km2":86600,"government":"Federal Republic","landlocked":true,"population":9939800,"life_expectancy":62.9,"population_density":120.3},{"code":"BY","emoji":"🇧🇾","country":"Belarus","area_km2":207600,"government":"Republic","landlocked":true,"population":9483499,"life_expectancy":68,"population_density":46.7},{"code":"BT","emoji":"🇧🇹","country":"Bhutan","area_km2":47000,"government":"Monarchy","landlocked":true,"population":754394,"life_expectancy":52.4,"population_density":19.8},{"code":"BO","emoji":"🇧🇴","country":"Bolivia","area_km2":1098581,"government":"Republic","landlocked":true,"population":11353142,"life_expectancy":63.7,"population_density":10.5},{"code":"BW","emoji":"🇧🇼","country":"Botswana","area_km2":581730,"government":"Republic","landlocked":true,"population":2254126,"life_expectancy":39.3,"population_density":4},{"code":"BF","emoji":"🇧🇫","country":"Burkina Faso","area_km2":274000,"government":"Republic","landlocked":true,"population":19751535,"life_expectancy":46.7,"population_density":72.2},{"code":"BI","emoji":"🇧🇮","country":"Burundi","area_km2":27834,"government":"Republic","landlocked":true,"population":11175378,"life_expectancy":46.2,"population_density":435.2},{"code":"CF","emoji":"🇨🇫","country":"Central African Republic","area_km2":622984,"government":"Republic","landlocked":true,"population":4666377,"life_expectancy":44,"population_density":7.5},{"code":"TD","emoji":"🇹🇩","country":"Chad","area_km2":1284000,"government":"Republic","landlocked":true,"population":15477751,"life_expectancy":50.5,"population_density":12.3},{"code":"CZ","emoji":"🇨🇿","country":"Czech Republic","area_km2":78866,"government":"Republic","landlocked":true,"population":10629928,"life_expectancy":74.5,"population_density":137.6},{"code":"SZ","emoji":"🇸🇿","country":"Eswatini","area_km2":17364,"government":"Monarchy","landlocked":true,"population":1136191,"life_expectancy":40.4,"population_density":66.1},{"code":"ET","emoji":"🇪🇹","country":"Ethiopia","area_km2":1104300,"government":"Republic","landlocked":true,"population":109224559,"life_expectancy":45.2,"population_density":109.2},{"code":"HU","emoji":"🇭🇺","country":"Hungary","area_km2":93030,"government":"Republic","landlocked":true,"population":9775564,"life_expectancy":71.4,"population_density":107.9},{"code":"KZ","emoji":"🇰🇿","country":"Kazakhstan","area_km2":2724900,"government":"Republic","landlocked":true,"population":18272430,"life_expectancy":63.2,"population_density":6.8},{"code":"KG","emoji":"🇰🇬","country":"Kyrgyzstan","area_km2":199900,"government":"Republic","landlocked":true,"population":6322800,"life_expectancy":63.4,"population_density":32.9},{"code":"LA","emoji":"🇱🇦","country":"Laos","area_km2":236800,"government":"Republic","landlocked":true,"population":7061507,"life_expectancy":53.1,"population_density":30.6},{"code":"LS","emoji":"🇱🇸","country":"Lesotho","area_km2":30355,"government":"Constitutional Monarchy","landlocked":true,"population":2108132,"life_expectancy":50.8,"population_density":69.4},{"code":"LI","emoji":"🇱🇮","country":"Liechtenstein","area_km2":160,"government":"Constitutional Monarchy","landlocked":true,"population":37910,"life_expectancy":78.8,"population_density":236.9},{"code":"LU","emoji":"🇱🇺","country":"Luxembourg","area_km2":2586,"government":"Constitutional Monarchy","landlocked":true,"population":607950,"life_expectancy":77.1,"population_density":250.1},{"code":"MW","emoji":"🇲🇼","country":"Malawi","area_km2":118484,"government":"Republic","landlocked":true,"population":18143315,"life_expectancy":37.6,"population_density":192.4},{"code":"ML","emoji":"🇲🇱","country":"Mali","area_km2":1240192,"government":"Republic","landlocked":true,"population":19077690,"life_expectancy":46.7,"population_density":15.6},{"code":"MD","emoji":"🇲🇩","country":"Moldova","area_km2":33851,"government":"Republic","landlocked":true,"population":2706049,"life_expectancy":64.5,"population_density":123.5},{"code":"MN","emoji":"🇲🇳","country":"Mongolia","area_km2":1566500,"government":"Republic","landlocked":true,"population":3170208,"life_expectancy":67.3,"population_density":2},{"code":"NP","emoji":"🇳🇵","country":"Nepal","area_km2":147181,"government":"Federal parliamentary republic","landlocked":true,"population":28087871,"life_expectancy":57.8,"population_density":195.9},{"code":"NE","emoji":"🇳🇪","country":"Niger","area_km2":1267000,"government":"Republic","landlocked":true,"population":22442948,"life_expectancy":41.3,"population_density":17.7},{"code":"MK","emoji":"🇲🇰","country":"North Macedonia","area_km2":25713,"government":"Republic","landlocked":true,"population":2084367,"life_expectancy":73.8,"population_density":82.6},{"code":"PY","emoji":"🇵🇾","country":"Paraguay","area_km2":406752,"government":"Republic","landlocked":true,"population":6956071,"life_expectancy":73.7,"population_density":17.5},{"code":"RW","emoji":"🇷🇼","country":"Rwanda","area_km2":26338,"government":"Republic","landlocked":true,"population":12301939,"life_expectancy":39.3,"population_density":498.7},{"code":"SM","emoji":"🇸🇲","country":"San Marino","area_km2":61,"government":"Republic","landlocked":true,"population":33785,"life_expectancy":81.1,"population_density":563.1},{"code":"RS","emoji":"🇷🇸","country":"Serbia","area_km2":88361,"government":"Republic","landlocked":true,"population":6963764,"life_expectancy":76,"population_density":100},{"code":"SK","emoji":"🇸🇰","country":"Slovakia","area_km2":49012,"government":"Republic","landlocked":true,"population":5446771,"life_expectancy":73.7,"population_density":113.3},{"code":"SS","emoji":"🇸🇸","country":"South Sudan","area_km2":619745,"landlocked":true,"population":10975920,"population_density":20.3},{"code":"CH","emoji":"🇨🇭","country":"Switzerland","area_km2":41284,"government":"Federation","landlocked":true,"population":8513227,"life_expectancy":79.6,"population_density":215.5},{"code":"TJ","emoji":"🇹🇯","country":"Tajikistan","area_km2":143100,"government":"Republic","landlocked":true,"population":9100837,"life_expectancy":64.1,"population_density":65.6},{"code":"TM","emoji":"🇹🇲","country":"Turkmenistan","area_km2":488100,"government":"Republic","landlocked":true,"population":5850908,"life_expectancy":60.9,"population_density":12.5},{"code":"UG","emoji":"🇺🇬","country":"Uganda","area_km2":241038,"government":"Republic","landlocked":true,"population":42723139,"life_expectancy":42.9,"population_density":213.1},{"code":"UZ","emoji":"🇺🇿","country":"Uzbekistan","area_km2":447400,"government":"Republic","landlocked":true,"population":32955400,"life_expectancy":63.7,"population_density":77.5},{"code":"ZM","emoji":"🇿🇲","country":"Zambia","area_km2":752618,"government":"Republic","landlocked":true,"population":17351822,"life_expectancy":37.2,"population_density":23.3},{"code":"ZW","emoji":"🇿🇼","country":"Zimbabwe","area_km2":390757,"government":"Republic","landlocked":true,"population":14439018,"life_expectancy":37.8,"population_density":37.3}]},"meta":{"timestamp":"2026-06-08T18:25:08.725Z","request_id":"6ec9b915-eff6-42dd-868a-6e3aedcaeb1c"},"status":"ok","message":"Countries listed successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Service metadata","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"service":"countrystats-api","endpoints":{"GET /v1/list":"List countries (limit, offset, landlocked=true to filter).","GET /v1/meta":"This document.","GET /v1/rank":"Rank countries by a metric (by=population|area_km2|population_density|life_expectancy, order=desc|asc, limit).","GET /v1/search":"Search by country name or government type (q=).","GET /v1/country":"All statistics for a country (country=, e.g. Germany — or code=, e.g. de)."},"description":"Country statistics: government type, landlocked flag, surface area (km²), population, population density and life expectancy, enriched with ISO 3166-1 alpha-2 code and flag emoji. Look up by country or code, rank by any numeric metric, search or list. Distinct from countries-api (ISO identifiers) and disease-api (health). No key.","total_countries":250,"rankable_metrics":["population","area_km2","population_density","life_expectancy"],"landlocked_countries":43},"meta":{"timestamp":"2026-06-08T18:25:08.844Z","request_id":"ecfe2253-d3a7-4bba-b28f-976ca5151353"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":18000,"rps_limit":3,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":700,"monthly_call_quota":200000,"rps_limit":10,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2200,"monthly_call_quota":1000000,"rps_limit":25,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5400,"monthly_call_quota":5000000,"rps_limit":60,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/countrystats-api"}