🌍
Country Data API
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.
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 | |
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 | |
mode | Lets you use our Development Environment to test the API without affecting your available requests (Learn more). |
All parameters with (*) are required.
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¶ms=language
Response:
{
"data": {
"countryCode": "US",
"countryName": "United States",
"countryGeoNameID": 6252001,
"capital": "Washington, D.C.",
"population": 331000000,
"language": {
"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¶ms=flag
Response:
{
"data": {
"countryCode": "US",
"countryName": "United States",
"countryGeoNameID": 6252001,
"capital": "Washington, D.C.",
"population": 331000000,
"flag": {
"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¶ms=currency
Response:
{
"data": {
"countryCode": "US",
"countryName": "United States",
"countryGeoNameID": 6252001,
"capital": "Washington, D.C.",
"population": 331000000,
"phoneCode": "1",
"currency": {
"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¶ms=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": {
"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
}
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¶ms=currency,language
{
"data": {
"countryCode": "BR",
"countryName": "Brazil",
"countryGeoNameID": 3469034,
"capital": "Brasilia",
"population": 211420000,
"language": {
"name": "Portuguese",
"code": "pt",
"native": "Português"
},
"phoneCode": "55",
"currency": {
"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
}
Key | Values |
---|---|
data.countryCode | String |
data.countryName | String |
data.countryGeoNameID | Integer |
data.capital | String |
data.population | String |
data.phoneCode | String |
data.countryIsEU | Boolean |
data.countryNeighbours | String (CSV) |
data.tld | String |
data.continentName | String |
data.continentCode | String |
data.continentGeoNameID | Integer |
data.language.name | String |
data.language.code | String |
data.language.native | String |
data.flag.emoji | String |
data.flag.unicode | String |
data.flag.png.1000px | String |
data.flag.png.250px | String |
data.flag.png.100px | String |
data.flag.svg | String |
data.flag.currency.currencyName | String |
data.flag.currency.currencyCode | String |
data.flag.currency.currencySymbol | String |
data.flag.timezone.name | String |
data.flag.timezone.abbreviation | String |
data.flag.timezone.offset | Intger (Could be a negative number) |
data.flag.timezone.currentTime | String |
data.flag.timezone.currentTimestamp | Integer |
data.flag.timezone.isDST | Boolean |
data.flag.timezone.sunInfo.sunset | String |
data.flag.timezone.sunInfo.sunrise | String |
data.flag.timezone.sunInfo.transit | String |
data.flag.timezone.sunInfo.civilTwilightBegin | String |
data.flag.timezone.sunInfo.civilTwilightEnd | String |
data.flag.timezone.sunInfo.nauticalTwilightBegin | String |
data.flag.timezone.sunInfo.nauticalTwilightEnd | String |
data.flag.timezone.sunInfo.astronomicalTwilightBegin | String |
data.flag.timezone.sunInfo.astronomicalTwilightEnd | String |
data.flag.timezone.sunInfo.dayLength | String |
Last modified 3mo ago