Country by IP Address API

Introduction

This API returns detailed information about the country identified by geolocating the provided IPv4/IPv6 IP address. This includes ISO-defined names, languages, currencies, United Nations and Word Bank defined region names and income levels. Powered by patent-pending Next Generation IP Geolocation Technology.

Get Started

This API is part of the IP Geolocation API Package and is available in free and paid plans. Please visit the IP Geolocation API Package package page for limits and pricing information.

Endpoints

IPv4 only API Endpoint

Use this endpoint to force API calls routed over the IPv4 network only

GET
https://api.bigdatacloud.net/data/country-by-ip

Dual-Stack API Endpoint

This endpoint has native IPv6 support and backs the API calls routed over both IPv4 and IPv6 networks

GET
https://api-bdc.net/data/country-by-ip

Request

Parameter
Type
Required
Description
ip
string
Optional, default value: [Caller's IP]
IPv4 IP address in a string or numeric format or IPv6 IP address in a string format. If omitted, the caller’s IP address is assumed
localityLanguage
string
Optional, default value: en
Preferred language for locality names in ISO 639-1 format, such as 'en' for English, 'es' for Spanish etc. If the requested language is unavailable for a requested location, it will default to English. If no English variant is available, will provide the native, local names. Use 'default' as the requested value to automatically adjust the language to the first administrative language in the Country.
key
string
Yes
Your API key

Responses

200
Success

Sample Query

GET
https://api-bdc.net/data/country-by-ip?ip=44.200.117.166&localityLanguage=en&key=[YOUR API KEY]

Schema

application/json
ipstring
Requested IP address in a string format.
localityLanguageRequestedstring
localityLanguage input parameter received
isReachableGloballyboolean
Indicated whether the IP address is present on the global routing table, hence reachable. If not reachable, the IP address is not in use and therefore cannot be geolocated
country
country object
isoAlpha2string
ISO 3166-1 Alpha-2 code
isoAlpha3string
ISO 3166-1 Alpha-3 code
m49Codeinteger
United Nations M.49 code
namestring
Country name localised to the language as defined by 'localityLanguage' request parameter
isoNamestring
ISO 3166-1 Country name short
isoNameFullstring
ISO 3166-1 Country name full
isoAdminLanguagesarray
Administrative languages as defined by ISO 3166-1 standard
isoAlpha3string
ISO 3166-1 Alpha-3 code
isoAlpha2string
ISO 3166-1 Alpha-2 code
isoNamestring
ISO 3166-1 Language name
nativeNamestring
A native name
unRegionstring
Region name as defined by the United Nations
currency
currency object
numericCodeinteger
ISO 4217 standard numeric code
codestring
ISO 4217 standard code
namestring
ISO 4217 English name
minorUnitsinteger
ISO 4217 minor units as the currency exponent (e.g. 2 = 1/100)
wbRegion
wbRegion object
idstring
world bank identification number. the expected values are: 'LCN','NA','SAS','SSF','ECS','MEA','EAS','NAC'
iso2Codestring
iso 2 letters code. the expected values are: 'ZJ','NA','8S','ZG','Z7','ZQ','Z4','XU'
valuestring
region name. the expected values are: 'Latin America & Caribbean','Aggregates','South Asia', 'Sub-Saharan Africa','Europe & Central Asia','Middle East & North Africa','East Asia & Pacific','North America'
wbIncomeLevel
wbIncomeLevel object
idstring
world bank identification number. the expected values are: 'HIC','NA','LIC','LMC','UMC','INX'
iso2Codestring
iso 2 letters code. the expected values are: 'XD','NA','XM','XN','XT','XY'
valuestring
income level name. the expected values are: 'High income','Aggregates','Low income','Lower middle income','Upper middle income','Not classified'
callingCodestring
Calling code
countryFlagEmojistring
Country emoji
wikidataIdstring
Wikidata item identifier, if available
geonameIdinteger
A unique identifier as is given by GeoNames.org
continentsarray
The list of Continents the Country belong to
continentstring
Continent name
continentCodestring
Continent code
lastUpdatedstring
Indicates the time of when that particular IP address’s geolocation was assessed the last

Sample Response

403
Access denied, or your quota limit has exceeded

Sample Response

404
Found no valid entry for the request

Sample Response

405
The requested IP address is not valid

Sample Response

500
An error has occurred and did not complete your request. Please try again

Sample Response

Was this page helpful?