Links
🌍

Country Data API

Overview

This method can help you retrieve information about the country by passing the Country Code to the request. This feature has been helping our users to empower their sites with the ability to know more about the visitor's country, so the website will be customized according to these data.
get
https://gregeoip.com
/Country
Method endpoint.

Method Parameters

Here's a list of all parameters can be used for this method:
Parameter
Description
key *
Your API Key.
CountryCode *
The Country Code of the country you want to fetch it's data.
params
The params you want to use (Check out the Possible Params section).
lang
The language of the API output. (EN, AR, DE, FR, ES, JA, ZH or RU)
format
The format of the API response. (JSON, XML, CSV or Newline)
callback
Tells the API to return the response as a callback function (Check out Callback section).
mode
Lets you use our Development Environment to test the API without affecting your available requests (Learn more).
All parameters with (*) are required.

Possible Param

This feature helps you determine the data you want to fetch about the Country Code.
Basic
Language
Flag
Currency
Timezone
This is the basic mode of the API. It will retrieve only the main data you need for the specified Country Code.
For example, you can send the request without passing the param parameter, like this:
https://gregeoip.com/Country?key=1234567890&CountryCode=US
Response:
{
"data": {
"countryCode": "US",
"countryName": "United States",
"countryGeoNameID": 6252001,
"capital": "Washington, D.C.",
"population": 331000000,
"phoneCode": "1",
"countryIsEU": false,
"countryNeighbours": "CA,MX,CU",
"tld": ".us",
"continentName": "North America",
"continentCode": "NA",
"continentGeoNameID": 6255149
},
"status": "success",
"executionTime": 0
}
Using the language param you'll be able to retrieve the language information related to the Country Code specified.
Example:
https://gregeoip.com/Country?key=1234567890&CountryCode=US&params=language
Response:
{
"data": {
"countryCode": "US",
"countryName": "United States",
"countryGeoNameID": 6252001,
"capital": "Washington, D.C.",
"population": 331000000,
"language": { // <---- The language object added
"name": "English",
"code": "en",
"native": "English"
},
"phoneCode": "1",
"countryIsEU": false,
"countryNeighbours": "CA,MX,CU",
"tld": ".us",
"continentName": "North America",
"continentCode": "NA",
"continentGeoNameID": 6255149
},
"status": "success",
"executionTime": 0
}
Using the flag param you'll be able to retrieve the flag formats of the Country Code specified.
Example:
https://gregeoip.com/Country?key=1234567890&CountryCode=US&params=flag
Response:
{
"data": {
"countryCode": "US",
"countryName": "United States",
"countryGeoNameID": 6252001,
"capital": "Washington, D.C.",
"population": 331000000,
"flag": { // <--- The flag object added
"emoji": "🇺🇸",
"unicode": "U+1F1FA U+1F1F8",
"png": {
"1000px": "https://www.gredev.io/img/flags/png1000px/us.png",
"250px": "https://www.gredev.io/img/flags/png250px/us.png",
"100px": "https://www.gredev.io/img/flags/png100px/us.png"
},
"svg": "https://www.gredev.io/img/flags/svg/us.svg"
},
"phoneCode": "1",
"countryIsEU": false,
"countryNeighbours": "CA,MX,CU",
"tld": ".us",
"continentName": "North America",
"continentCode": "NA",
"continentGeoNameID": 6255149
},
"status": "success",
"executionTime": 0
}
Using the currency param you'll be able to retrieve the currency information of the Country Code specified.
Example:
https://gregeoip.com/Country?key=1234567890&CountryCode=US&params=currency
Response:
{
"data": {
"countryCode": "US",
"countryName": "United States",
"countryGeoNameID": 6252001,
"capital": "Washington, D.C.",
"population": 331000000,
"phoneCode": "1",
"currency": { // <--- The currency object added
"currencyName": "United States Dollar",
"currencyCode": "USD",
"currencySymbol": "$"
},
"countryIsEU": false,
"countryNeighbours": "CA,MX,CU",
"tld": ".us",
"continentName": "North America",
"continentCode": "NA",
"continentGeoNameID": 6255149
},
"status": "success",
"executionTime": 0
}
Using the timezone param you'll be able to retrieve the timezone information of the Country Code specified.
Example:
https://gregeoip.com/Country?key=1234567890&CountryCode=US&params=timezone
Response:
{
"data": {
"countryCode": "US",
"countryName": "United States",
"countryGeoNameID": 6252001,
"capital": "Washington, D.C.",
"population": 331000000,
"phoneCode": "1",
"countryIsEU": false,
"countryNeighbours": "CA,MX,CU",
"tld": ".us",
"timezone": { // <--- The timezone object added
"name": "America/Adak",
"abbreviation": "HST",
"offset": -36000,
"currentTime": "11:51:19",
"currentTimestamp": 1643406679,
"isDST": false,
"sunInfo": {
"sunset": "08:17:34",
"sunrise": "20:08:16",
"transit": "02:12:55",
"civilTwilightBegin": "19:47:39",
"civilTwilightEnd": "08:38:10",
"nauticalTwilightBegin": "19:22:22",
"nauticalTwilightEnd": "09:03:28",
"astronomicalTwilightBegin": "18:57:01",
"astronomicalTwilightEnd": "09:28:49",
"dayLength": "11:50:42"
}
},
"continentName": "North America",
"continentCode": "NA",
"continentGeoNameID": 6255149
},
"status": "success",
"executionTime": 0
}

Using Multiple Params

You can also use multiple params in a single request by separating them with comma (,).
For example, to fetch both currency and language information of Brazil, you will do as following:
https://gregeoip.com/Country?key=1234567890&CountryCode=BR&params=currency,language
Response:
{
"data": {
"countryCode": "BR",
"countryName": "Brazil",
"countryGeoNameID": 3469034,
"capital": "Brasilia",
"population": 211420000,
"language": { // <--- The language object added
"name": "Portuguese",
"code": "pt",
"native": "Português"
},
"phoneCode": "55",
"currency": { // <--- The currency object added
"currencyName": "Brazilian Real",
"currencyCode": "BRL",
"currencySymbol": "R$"
},
"countryIsEU": false,
"countryNeighbours": "SR,PE,BO,UY,GY,PY,GF,VE,CO,AR",
"tld": ".br",
"continentName": "South America",
"continentCode": "SA",
"continentGeoNameID": 6255150
},
"status": "success",
"executionTime": 0
}