Caller’s country
curl --request GET \
--url https://api.reqi.dev/v1/countries/currentimport requests
url = "https://api.reqi.dev/v1/countries/current"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.reqi.dev/v1/countries/current', 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/countries/current",
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/countries/current"
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/countries/current")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reqi.dev/v1/countries/current")
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
}Countries
Caller’s country
Returns one country object inferred from the request IP via edge geo headers (for example x-vercel-ip-country on Vercel). Response header X-Request-Country is the detected ISO 3166-1 alpha-2 code. Supports fields projection only (no limit/offset).
GET
/
v1
/
countries
/
current
Caller’s country
curl --request GET \
--url https://api.reqi.dev/v1/countries/currentimport requests
url = "https://api.reqi.dev/v1/countries/current"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.reqi.dev/v1/countries/current', 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/countries/current",
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/countries/current"
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/countries/current")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reqi.dev/v1/countries/current")
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
}Query Parameters
Comma-separated field list. Supports dot paths (name.common). Use * or omit for the full object.
Response
Projected country object for the detected location.
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