Skip to main content
import { GetConversion, SELECT } from '@ip2geo/sdk'

const { data } = await GetConversion({
    conversionId: 'your-conversion-uuid',
    select: [
        SELECT.CONTINENT.COUNTRY.NAME,
        SELECT.CONTINENT.COUNTRY.CODE,
        SELECT.ASN.NAME
    ]
})
SELECT.IPip
SELECT.TYPEtype
SELECT.IS_EUis_eu
SELECT.CONTINENT.NAMEcontinent.name
SELECT.CONTINENT.CODEcontinent.code
SELECT.CONTINENT.GEONAME_IDcontinent.geoname_id
SELECT.CONTINENT.COUNTRY.NAMEcontinent.country.name
SELECT.CONTINENT.COUNTRY.CODEcontinent.country.code
SELECT.CONTINENT.COUNTRY.GEONAME_IDcontinent.country.geoname_id
SELECT.CONTINENT.COUNTRY.PHONE_CODEcontinent.country.phone_code
SELECT.CONTINENT.COUNTRY.CAPITALcontinent.country.capital
SELECT.CONTINENT.COUNTRY.TLDcontinent.country.tld
SELECT.CONTINENT.COUNTRY.SUBDIVISION.NAMEcontinent.country.subdivision.name
SELECT.CONTINENT.COUNTRY.SUBDIVISION.CODEcontinent.country.subdivision.code
SELECT.CONTINENT.COUNTRY.CITY.NAMEcontinent.country.city.name
SELECT.CONTINENT.COUNTRY.CITY.GEONAME_IDcontinent.country.city.geoname_id
SELECT.CONTINENT.COUNTRY.CITY.LATITUDEcontinent.country.city.latitude
SELECT.CONTINENT.COUNTRY.CITY.LONGITUDEcontinent.country.city.longitude
SELECT.CONTINENT.COUNTRY.CITY.ACCURACY_RADIUScontinent.country.city.accuracy_radius
SELECT.CONTINENT.COUNTRY.CITY.METRO_CODEcontinent.country.city.metro_code
SELECT.CONTINENT.COUNTRY.CITY.POSTAL_CODEcontinent.country.city.postal_code
SELECT.CONTINENT.COUNTRY.CITY.TIMEZONE.NAMEcontinent.country.city.timezone.name
SELECT.CONTINENT.COUNTRY.CITY.TIMEZONE.TIME_NOWcontinent.country.city.timezone.time_now
SELECT.CONTINENT.COUNTRY.FLAG.IMGcontinent.country.flag.img
SELECT.CONTINENT.COUNTRY.FLAG.EMOJIcontinent.country.flag.emoji
SELECT.CONTINENT.COUNTRY.FLAG.EMOJI_UNICODEcontinent.country.flag.emoji_unicode
SELECT.CONTINENT.COUNTRY.CURRENCY.NAMEcontinent.country.currency.name
SELECT.CONTINENT.COUNTRY.CURRENCY.CODEcontinent.country.currency.code
SELECT.CONTINENT.COUNTRY.CURRENCY.SYMBOLcontinent.country.currency.symbol
SELECT.REGISTERED_COUNTRY.NAMEregistered_country.name
SELECT.REGISTERED_COUNTRY.CODEregistered_country.code
SELECT.REGISTERED_COUNTRY.GEONAME_IDregistered_country.geoname_id
SELECT.ASN.NUMBERasn.number
SELECT.ASN.NAMEasn.name
SELECT.COMPLETION_TIME.MILISECONDScompletion_time.miliseconds
SELECT.COMPLETION_TIME.SECONDScompletion_time.seconds
const SELECT = {
    IP: 'ip',
    TYPE: 'type',
    IS_EU: 'is_eu',
    CONTINENT: {
        NAME: 'continent.name',
        CODE: 'continent.code',
        GEONAME_ID: 'continent.geoname_id',
        COUNTRY: {
            NAME: 'continent.country.name',
            CODE: 'continent.country.code',
            GEONAME_ID: 'continent.country.geoname_id',
            PHONE_CODE: 'continent.country.phone_code',
            CAPITAL: 'continent.country.capital',
            TLD: 'continent.country.tld',
            SUBDIVISION: {
                NAME: 'continent.country.subdivision.name',
                CODE: 'continent.country.subdivision.code'
            },
            CITY: {
                NAME: 'continent.country.city.name',
                GEONAME_ID: 'continent.country.city.geoname_id',
                LATITUDE: 'continent.country.city.latitude',
                LONGITUDE: 'continent.country.city.longitude',
                ACCURACY_RADIUS: 'continent.country.city.accuracy_radius',
                METRO_CODE: 'continent.country.city.metro_code',
                POSTAL_CODE: 'continent.country.city.postal_code',
                TIMEZONE: {
                    NAME: 'continent.country.city.timezone.name',
                    TIME_NOW: 'continent.country.city.timezone.time_now'
                }
            },
            FLAG: {
                IMG: 'continent.country.flag.img',
                EMOJI: 'continent.country.flag.emoji',
                EMOJI_UNICODE: 'continent.country.flag.emoji_unicode'
            },
            CURRENCY: {
                NAME: 'continent.country.currency.name',
                CODE: 'continent.country.currency.code',
                SYMBOL: 'continent.country.currency.symbol'
            }
        }
    },
    REGISTERED_COUNTRY: {
        NAME: 'registered_country.name',
        CODE: 'registered_country.code',
        GEONAME_ID: 'registered_country.geoname_id'
    },
    ASN: {
        NUMBER: 'asn.number',
        NAME: 'asn.name'
    },
    COMPLETION_TIME: {
        MILISECONDS: 'completion_time.miliseconds',
        SECONDS: 'completion_time.seconds'
    }
}