Rank countries by metric
curl --request GET \
--url https://api.reqi.dev/v1/rank/{metric}import requests
url = "https://api.reqi.dev/v1/rank/{metric}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.reqi.dev/v1/rank/{metric}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reqi.dev/v1/rank/{metric}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.reqi.dev/v1/rank/{metric}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.reqi.dev/v1/rank/{metric}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reqi.dev/v1/rank/{metric}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"name": {
"common": "<string>",
"official": "<string>",
"native": {}
},
"cca2": "<string>",
"cca3": "<string>",
"population": 123,
"flags": {
"svg": "<string>",
"png": "<string>",
"alt": "<string>"
},
"tld": [
"<string>"
],
"ccn3": "<string>",
"cioc": "<string>",
"independent": true,
"status": "<string>",
"unMember": true,
"unRegionalGroup": "<string>",
"wikidataId": "<string>",
"currencies": {},
"capital": [
"<string>"
],
"altSpellings": [
"<string>"
],
"region": "<string>",
"subregion": "<string>",
"languages": {},
"translations": {},
"latlng": [
123
],
"landlocked": true,
"borders": [
"<string>"
],
"area": 123,
"flag": "<string>",
"demonyms": {},
"capitalInfo": {},
"enrichment": {
"fetchedAt": "2023-11-07T05:31:56Z",
"population": {
"value": 123,
"source": "wikidata",
"asOf": "<string>"
},
"economics": {
"gdp": 123,
"gdpPerCapita": 123,
"gdpYear": 123
},
"development": {
"hdi": 123,
"lifeExpectancy": 123,
"gini": 123
},
"government": {
"type": "<string>",
"website": "<string>"
},
"company": {
"name": "<string>",
"wikidataId": "<string>",
"revenue": 123,
"profit": 123,
"asOf": "<string>"
},
"computed": {
"populationDensity": 123,
"capitalPopulationShare": 123
}
},
"holidays": {
"source": "nager.date",
"fetchedAt": "2023-11-07T05:31:56Z",
"years": [
123
],
"items": [
{
"date": "2023-12-25",
"localName": "<string>",
"name": "<string>",
"types": [
"<string>"
]
}
]
},
"maps": {},
"fifa": "<string>",
"timezones": [
"<string>"
],
"continents": [
"<string>"
]
}
]{
"message": "<string>",
"status": 123
}{
"message": "<string>",
"status": 123
}Rankings
Rank countries by metric
Returns countries sorted by a numeric metric. Rows without enrichment data are omitted. Headers: X-Rank-Metric, X-Rank-Order, X-Rank-Definition.
GET
/
v1
/
rank
/
{metric}
Rank countries by metric
curl --request GET \
--url https://api.reqi.dev/v1/rank/{metric}import requests
url = "https://api.reqi.dev/v1/rank/{metric}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.reqi.dev/v1/rank/{metric}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reqi.dev/v1/rank/{metric}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.reqi.dev/v1/rank/{metric}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.reqi.dev/v1/rank/{metric}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reqi.dev/v1/rank/{metric}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"name": {
"common": "<string>",
"official": "<string>",
"native": {}
},
"cca2": "<string>",
"cca3": "<string>",
"population": 123,
"flags": {
"svg": "<string>",
"png": "<string>",
"alt": "<string>"
},
"tld": [
"<string>"
],
"ccn3": "<string>",
"cioc": "<string>",
"independent": true,
"status": "<string>",
"unMember": true,
"unRegionalGroup": "<string>",
"wikidataId": "<string>",
"currencies": {},
"capital": [
"<string>"
],
"altSpellings": [
"<string>"
],
"region": "<string>",
"subregion": "<string>",
"languages": {},
"translations": {},
"latlng": [
123
],
"landlocked": true,
"borders": [
"<string>"
],
"area": 123,
"flag": "<string>",
"demonyms": {},
"capitalInfo": {},
"enrichment": {
"fetchedAt": "2023-11-07T05:31:56Z",
"population": {
"value": 123,
"source": "wikidata",
"asOf": "<string>"
},
"economics": {
"gdp": 123,
"gdpPerCapita": 123,
"gdpYear": 123
},
"development": {
"hdi": 123,
"lifeExpectancy": 123,
"gini": 123
},
"government": {
"type": "<string>",
"website": "<string>"
},
"company": {
"name": "<string>",
"wikidataId": "<string>",
"revenue": 123,
"profit": 123,
"asOf": "<string>"
},
"computed": {
"populationDensity": 123,
"capitalPopulationShare": 123
}
},
"holidays": {
"source": "nager.date",
"fetchedAt": "2023-11-07T05:31:56Z",
"years": [
123
],
"items": [
{
"date": "2023-12-25",
"localName": "<string>",
"name": "<string>",
"types": [
"<string>"
]
}
]
},
"maps": {},
"fifa": "<string>",
"timezones": [
"<string>"
],
"continents": [
"<string>"
]
}
]{
"message": "<string>",
"status": 123
}{
"message": "<string>",
"status": 123
}Returns countries sorted by a numeric metric. Rows without enrichment data are omitted. Headers: X-Rank-Metric, X-Rank-Order, X-Rank-Definition.
Path Parameters
Ranking metric id.
Available options:
population, area, gdp, gdpPerCapita, hdi, lifeExpectancy, populationDensity Query Parameters
Sort direction. Default desc.
Available options:
asc, desc Comma-separated field list. Supports dot paths (name.common). Use * or omit for the full object.
Page size from 1 to 25. Default 5.
Required range:
1 <= x <= 25Number of matches to skip. Default 0. Used when page is omitted.
Required range:
x >= 0Response
JSON array of country objects (possibly projected).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes