SELECT constants allow you to retrieve only the data fields you need instead of the full conversion, reducing payload size and improving performance. They work with both the SDK’s and the API.
import { GetConversion, SELECT } from '@ip2geo/sdk'
const { data } = await GetConversion({
conversionId: 'your-conversion-uuid',
select: [
SELECT.COUNTRY_NAME,
SELECT.COUNTRY_CODE,
SELECT.ASN_NAME
]
})
result = Ip2Geo.get_conversion(
conversion_id: 'your-conversion-uuid',
select: [
Ip2Geo.select[:COUNTRY_NAME],
Ip2Geo.select[:COUNTRY_CODE],
Ip2Geo.select[:ASN_NAME]
]
)
result = ip2geo.get_conversion(
conversion_id='your-conversion-uuid',
select=[
ip2geo.SELECT['COUNTRY_NAME'],
ip2geo.SELECT['COUNTRY_CODE'],
ip2geo.SELECT['ASN_NAME']
]
)
$result = Ip2Geo::getConversion(
conversionId: 'your-conversion-uuid',
select: [
Ip2Geo::SELECT['COUNTRY_NAME'],
Ip2Geo::SELECT['COUNTRY_CODE'],
Ip2Geo::SELECT['ASN_NAME']
]
);
- TypeScript
- Ruby
- Python
- PHP
The full list of
SELECT constant you can import and use when retrieving data:| Constant | Value |
|---|---|
SELECT.IP | 'ip' |
SELECT.TYPE | 'type' |
SELECT.IS_EU | 'is_eu' |
SELECT.CONTINENT_NAME | 'continent.name' |
SELECT.CONTINENT_CODE | 'continent.code' |
SELECT.CONTINENT_GEONAME_ID | 'continent.geoname_id' |
SELECT.COUNTRY_NAME | 'continent.country.name' |
SELECT.COUNTRY_CODE | 'continent.country.code' |
SELECT.COUNTRY_GEONAME_ID | 'continent.country.geoname_id' |
SELECT.COUNTRY_PHONE_CODE | 'continent.country.phone_code' |
SELECT.COUNTRY_CAPITAL | 'continent.country.capital' |
SELECT.COUNTRY_TLD | 'continent.country.tld' |
SELECT.SUBDIVISION_NAME | 'continent.country.subdivision.name' |
SELECT.SUBDIVISION_CODE | 'continent.country.subdivision.code' |
SELECT.CITY_NAME | 'continent.country.city.name' |
SELECT.CITY_GEONAME_ID | 'continent.country.city.geoname_id' |
SELECT.CITY_LATITUDE | 'continent.country.city.latitude' |
SELECT.CITY_LONGITUDE | 'continent.country.city.longitude' |
SELECT.CITY_ACCURACY_RADIUS | 'continent.country.city.accuracy_radius' |
SELECT.CITY_METRO_CODE | 'continent.country.city.metro_code' |
SELECT.CITY_POSTAL_CODE | 'continent.country.city.postal_code' |
SELECT.TIMEZONE_NAME | 'continent.country.city.timezone.name' |
SELECT.TIMEZONE_TIME_NOW | 'continent.country.city.timezone.time_now' |
SELECT.FLAG_IMG | 'continent.country.flag.img' |
SELECT.FLAG_EMOJI | 'continent.country.flag.emoji' |
SELECT.FLAG_EMOJI_UNICODE | 'continent.country.flag.emoji_unicode' |
SELECT.CURRENCY_NAME | 'continent.country.currency.name' |
SELECT.CURRENCY_CODE | 'continent.country.currency.code' |
SELECT.CURRENCY_SYMBOL | 'continent.country.currency.symbol' |
SELECT.REGISTERED_COUNTRY_NAME | 'registered_country.name' |
SELECT.REGISTERED_COUNTRY_CODE | 'registered_country.code' |
SELECT.REGISTERED_COUNTRY_GEONAME_ID | 'registered_country.geoname_id' |
SELECT.ASN_NUMBER | 'asn.number' |
SELECT.ASN_NAME | 'asn.name' |
SELECT.COMPLETION_TIME_MILISECONDS | 'completion_time.miliseconds' |
SELECT.COMPLETION_TIME_SECONDS | 'completion_time.seconds' |
The full list of
Ip2Geo.select constant you can use when retrieving data:| Constant | Value |
|---|---|
Ip2Geo.select[:IP] | 'ip' |
Ip2Geo.select[:TYPE] | 'type' |
Ip2Geo.select[:IS_EU] | 'is_eu' |
Ip2Geo.select[:CONTINENT_NAME] | 'continent.name' |
Ip2Geo.select[:CONTINENT_CODE] | 'continent.code' |
Ip2Geo.select[:CONTINENT_GEONAME_ID] | 'continent.geoname_id' |
Ip2Geo.select[:COUNTRY_NAME] | 'continent.country.name' |
Ip2Geo.select[:COUNTRY_CODE] | 'continent.country.code' |
Ip2Geo.select[:COUNTRY_GEONAME_ID] | 'continent.country.geoname_id' |
Ip2Geo.select[:COUNTRY_PHONE_CODE] | 'continent.country.phone_code' |
Ip2Geo.select[:COUNTRY_CAPITAL] | 'continent.country.capital' |
Ip2Geo.select[:COUNTRY_TLD] | 'continent.country.tld' |
Ip2Geo.select[:SUBDIVISION_NAME] | 'continent.country.subdivision.name' |
Ip2Geo.select[:SUBDIVISION_CODE] | 'continent.country.subdivision.code' |
Ip2Geo.select[:CITY_NAME] | 'continent.country.city.name' |
Ip2Geo.select[:CITY_GEONAME_ID] | 'continent.country.city.geoname_id' |
Ip2Geo.select[:CITY_LATITUDE] | 'continent.country.city.latitude' |
Ip2Geo.select[:CITY_LONGITUDE] | 'continent.country.city.longitude' |
Ip2Geo.select[:CITY_ACCURACY_RADIUS] | 'continent.country.city.accuracy_radius' |
Ip2Geo.select[:CITY_METRO_CODE] | 'continent.country.city.metro_code' |
Ip2Geo.select[:CITY_POSTAL_CODE] | 'continent.country.city.postal_code' |
Ip2Geo.select[:TIMEZONE_NAME] | 'continent.country.city.timezone.name' |
Ip2Geo.select[:TIMEZONE_TIME_NOW] | 'continent.country.city.timezone.time_now' |
Ip2Geo.select[:FLAG_IMG] | 'continent.country.flag.img' |
Ip2Geo.select[:FLAG_EMOJI] | 'continent.country.flag.emoji' |
Ip2Geo.select[:FLAG_EMOJI_UNICODE] | 'continent.country.flag.emoji_unicode' |
Ip2Geo.select[:CURRENCY_NAME] | 'continent.country.currency.name' |
Ip2Geo.select[:CURRENCY_CODE] | 'continent.country.currency.code' |
Ip2Geo.select[:CURRENCY_SYMBOL] | 'continent.country.currency.symbol' |
Ip2Geo.select[:REGISTERED_COUNTRY_NAME] | 'registered_country.name' |
Ip2Geo.select[:REGISTERED_COUNTRY_CODE] | 'registered_country.code' |
Ip2Geo.select[:REGISTERED_COUNTRY_GEONAME_ID] | 'registered_country.geoname_id' |
Ip2Geo.select[:ASN_NUMBER] | 'asn.number' |
Ip2Geo.select[:ASN_NAME] | 'asn.name' |
Ip2Geo.select[:COMPLETION_TIME_MILISECONDS] | 'completion_time.miliseconds' |
Ip2Geo.select[:COMPLETION_TIME_SECONDS] | 'completion_time.seconds' |
The full list of
ip2geo.SELECT constant you can use when retrieving data:| Constant | Value |
|---|---|
ip2geo.SELECT['IP'] | 'ip' |
ip2geo.SELECT['TYPE'] | 'type' |
ip2geo.SELECT['IS_EU'] | 'is_eu' |
ip2geo.SELECT['CONTINENT_NAME'] | 'continent.name' |
ip2geo.SELECT['CONTINENT_CODE'] | 'continent.code' |
ip2geo.SELECT['CONTINENT_GEONAME_ID'] | 'continent.geoname_id' |
ip2geo.SELECT['COUNTRY_NAME'] | 'continent.country.name' |
ip2geo.SELECT['COUNTRY_CODE'] | 'continent.country.code' |
ip2geo.SELECT['COUNTRY_GEONAME_ID'] | 'continent.country.geoname_id' |
ip2geo.SELECT['COUNTRY_PHONE_CODE'] | 'continent.country.phone_code' |
ip2geo.SELECT['COUNTRY_CAPITAL'] | 'continent.country.capital' |
ip2geo.SELECT['COUNTRY_TLD'] | 'continent.country.tld' |
ip2geo.SELECT['SUBDIVISION_NAME'] | 'continent.country.subdivision.name' |
ip2geo.SELECT['SUBDIVISION_CODE'] | 'continent.country.subdivision.code' |
ip2geo.SELECT['CITY_NAME'] | 'continent.country.city.name' |
ip2geo.SELECT['CITY_GEONAME_ID'] | 'continent.country.city.geoname_id' |
ip2geo.SELECT['CITY_LATITUDE'] | 'continent.country.city.latitude' |
ip2geo.SELECT['CITY_LONGITUDE'] | 'continent.country.city.longitude' |
ip2geo.SELECT['CITY_ACCURACY_RADIUS'] | 'continent.country.city.accuracy_radius' |
ip2geo.SELECT['CITY_METRO_CODE'] | 'continent.country.city.metro_code' |
ip2geo.SELECT['CITY_POSTAL_CODE'] | 'continent.country.city.postal_code' |
ip2geo.SELECT['TIMEZONE_NAME'] | 'continent.country.city.timezone.name' |
ip2geo.SELECT['TIMEZONE_TIME_NOW'] | 'continent.country.city.timezone.time_now' |
ip2geo.SELECT['FLAG_IMG'] | 'continent.country.flag.img' |
ip2geo.SELECT['FLAG_EMOJI'] | 'continent.country.flag.emoji' |
ip2geo.SELECT['FLAG_EMOJI_UNICODE'] | 'continent.country.flag.emoji_unicode' |
ip2geo.SELECT['CURRENCY_NAME'] | 'continent.country.currency.name' |
ip2geo.SELECT['CURRENCY_CODE'] | 'continent.country.currency.code' |
ip2geo.SELECT['CURRENCY_SYMBOL'] | 'continent.country.currency.symbol' |
ip2geo.SELECT['REGISTERED_COUNTRY_NAME'] | 'registered_country.name' |
ip2geo.SELECT['REGISTERED_COUNTRY_CODE'] | 'registered_country.code' |
ip2geo.SELECT['REGISTERED_COUNTRY_GEONAME_ID'] | 'registered_country.geoname_id' |
ip2geo.SELECT['ASN_NUMBER'] | 'asn.number' |
ip2geo.SELECT['ASN_NAME'] | 'asn.name' |
ip2geo.SELECT['COMPLETION_TIME_MILISECONDS'] | 'completion_time.miliseconds' |
ip2geo.SELECT['COMPLETION_TIME_SECONDS'] | 'completion_time.seconds' |
The full list of
Ip2Geo::SELECT constant you can use when retrieving data:| Constant | Value |
|---|---|
Ip2Geo::SELECT['IP'] | 'ip' |
Ip2Geo::SELECT['TYPE'] | 'type' |
Ip2Geo::SELECT['IS_EU'] | 'is_eu' |
Ip2Geo::SELECT['CONTINENT_NAME'] | 'continent.name' |
Ip2Geo::SELECT['CONTINENT_CODE'] | 'continent.code' |
Ip2Geo::SELECT['CONTINENT_GEONAME_ID'] | 'continent.geoname_id' |
Ip2Geo::SELECT['COUNTRY_NAME'] | 'continent.country.name' |
Ip2Geo::SELECT['COUNTRY_CODE'] | 'continent.country.code' |
Ip2Geo::SELECT['COUNTRY_GEONAME_ID'] | 'continent.country.geoname_id' |
Ip2Geo::SELECT['COUNTRY_PHONE_CODE'] | 'continent.country.phone_code' |
Ip2Geo::SELECT['COUNTRY_CAPITAL'] | 'continent.country.capital' |
Ip2Geo::SELECT['COUNTRY_TLD'] | 'continent.country.tld' |
Ip2Geo::SELECT['SUBDIVISION_NAME'] | 'continent.country.subdivision.name' |
Ip2Geo::SELECT['SUBDIVISION_CODE'] | 'continent.country.subdivision.code' |
Ip2Geo::SELECT['CITY_NAME'] | 'continent.country.city.name' |
Ip2Geo::SELECT['CITY_GEONAME_ID'] | 'continent.country.city.geoname_id' |
Ip2Geo::SELECT['CITY_LATITUDE'] | 'continent.country.city.latitude' |
Ip2Geo::SELECT['CITY_LONGITUDE'] | 'continent.country.city.longitude' |
Ip2Geo::SELECT['CITY_ACCURACY_RADIUS'] | 'continent.country.city.accuracy_radius' |
Ip2Geo::SELECT['CITY_METRO_CODE'] | 'continent.country.city.metro_code' |
Ip2Geo::SELECT['CITY_POSTAL_CODE'] | 'continent.country.city.postal_code' |
Ip2Geo::SELECT['TIMEZONE_NAME'] | 'continent.country.city.timezone.name' |
Ip2Geo::SELECT['TIMEZONE_TIME_NOW'] | 'continent.country.city.timezone.time_now' |
Ip2Geo::SELECT['FLAG_IMG'] | 'continent.country.flag.img' |
Ip2Geo::SELECT['FLAG_EMOJI'] | 'continent.country.flag.emoji' |
Ip2Geo::SELECT['FLAG_EMOJI_UNICODE'] | 'continent.country.flag.emoji_unicode' |
Ip2Geo::SELECT['CURRENCY_NAME'] | 'continent.country.currency.name' |
Ip2Geo::SELECT['CURRENCY_CODE'] | 'continent.country.currency.code' |
Ip2Geo::SELECT['CURRENCY_SYMBOL'] | 'continent.country.currency.symbol' |
Ip2Geo::SELECT['REGISTERED_COUNTRY_NAME'] | 'registered_country.name' |
Ip2Geo::SELECT['REGISTERED_COUNTRY_CODE'] | 'registered_country.code' |
Ip2Geo::SELECT['REGISTERED_COUNTRY_GEONAME_ID'] | 'registered_country.geoname_id' |
Ip2Geo::SELECT['ASN_NUMBER'] | 'asn.number' |
Ip2Geo::SELECT['ASN_NAME'] | 'asn.name' |
Ip2Geo::SELECT['COMPLETION_TIME_MILISECONDS'] | 'completion_time.miliseconds' |
Ip2Geo::SELECT['COMPLETION_TIME_SECONDS'] | 'completion_time.seconds' |
Raw Values
In case you are using the API instead of our SDKs to call it, here are the raw constants you can use for reference.const SELECT = {
IP: 'ip',
TYPE: 'type',
IS_EU: 'is_eu',
CONTINENT_NAME: 'continent.name',
CONTINENT_CODE: 'continent.code',
CONTINENT_GEONAME_ID: 'continent.geoname_id',
COUNTRY_NAME: 'continent.country.name',
COUNTRY_CODE: 'continent.country.code',
COUNTRY_GEONAME_ID: 'continent.country.geoname_id',
COUNTRY_PHONE_CODE: 'continent.country.phone_code',
COUNTRY_CAPITAL: 'continent.country.capital',
COUNTRY_TLD: 'continent.country.tld',
SUBDIVISION_NAME: 'continent.country.subdivision.name',
SUBDIVISION_CODE: 'continent.country.subdivision.code',
CITY_NAME: 'continent.country.city.name',
CITY_GEONAME_ID: 'continent.country.city.geoname_id',
CITY_LATITUDE: 'continent.country.city.latitude',
CITY_LONGITUDE: 'continent.country.city.longitude',
CITY_ACCURACY_RADIUS: 'continent.country.city.accuracy_radius',
CITY_METRO_CODE: 'continent.country.city.metro_code',
CITY_POSTAL_CODE: 'continent.country.city.postal_code',
TIMEZONE_NAME: 'continent.country.city.timezone.name',
TIMEZONE_TIME_NOW: 'continent.country.city.timezone.time_now',
FLAG_IMG: 'continent.country.flag.img',
FLAG_EMOJI: 'continent.country.flag.emoji',
FLAG_EMOJI_UNICODE: 'continent.country.flag.emoji_unicode',
CURRENCY_NAME: 'continent.country.currency.name',
CURRENCY_CODE: 'continent.country.currency.code',
CURRENCY_SYMBOL: 'continent.country.currency.symbol',
REGISTERED_COUNTRY_NAME: 'registered_country.name',
REGISTERED_COUNTRY_CODE: 'registered_country.code',
REGISTERED_COUNTRY_GEONAME_ID: 'registered_country.geoname_id',
ASN_NUMBER: 'asn.number',
ASN_NAME: 'asn.name',
COMPLETION_TIME_MILISECONDS: 'completion_time.miliseconds',
COMPLETION_TIME_SECONDS: 'completion_time.seconds'
}
SELECT = {
IP: 'ip',
TYPE: 'type',
IS_EU: 'is_eu',
CONTINENT_NAME: 'continent.name',
CONTINENT_CODE: 'continent.code',
CONTINENT_GEONAME_ID: 'continent.geoname_id',
COUNTRY_NAME: 'continent.country.name',
COUNTRY_CODE: 'continent.country.code',
COUNTRY_GEONAME_ID: 'continent.country.geoname_id',
COUNTRY_PHONE_CODE: 'continent.country.phone_code',
COUNTRY_CAPITAL: 'continent.country.capital',
COUNTRY_TLD: 'continent.country.tld',
SUBDIVISION_NAME: 'continent.country.subdivision.name',
SUBDIVISION_CODE: 'continent.country.subdivision.code',
CITY_NAME: 'continent.country.city.name',
CITY_GEONAME_ID: 'continent.country.city.geoname_id',
CITY_LATITUDE: 'continent.country.city.latitude',
CITY_LONGITUDE: 'continent.country.city.longitude',
CITY_ACCURACY_RADIUS: 'continent.country.city.accuracy_radius',
CITY_METRO_CODE: 'continent.country.city.metro_code',
CITY_POSTAL_CODE: 'continent.country.city.postal_code',
TIMEZONE_NAME: 'continent.country.city.timezone.name',
TIMEZONE_TIME_NOW: 'continent.country.city.timezone.time_now',
FLAG_IMG: 'continent.country.flag.img',
FLAG_EMOJI: 'continent.country.flag.emoji',
FLAG_EMOJI_UNICODE: 'continent.country.flag.emoji_unicode',
CURRENCY_NAME: 'continent.country.currency.name',
CURRENCY_CODE: 'continent.country.currency.code',
CURRENCY_SYMBOL: 'continent.country.currency.symbol',
REGISTERED_COUNTRY_NAME: 'registered_country.name',
REGISTERED_COUNTRY_CODE: 'registered_country.code',
REGISTERED_COUNTRY_GEONAME_ID: 'registered_country.geoname_id',
ASN_NUMBER: 'asn.number',
ASN_NAME: 'asn.name',
COMPLETION_TIME_MILISECONDS: 'completion_time.miliseconds',
COMPLETION_TIME_SECONDS: 'completion_time.seconds'
}