Skip to main content
This function allows you to retrieve a single conversion by its unique identifier, see an example below:
You should authenticate/initialize Ip2Geo before using this method.
import { GetConversion } from '@ip2geo/sdk'

const conversionId = 'your-conversion-uuid'

const { data, success, message } = await GetConversion({
    conversionId: conversionId
})

With Select Fields

You can specify which fields to return using the select parameter:
import { GetConversion, SELECT } from '@ip2geo/sdk'

const { data, success, message } = await GetConversion({
    conversionId: 'your-conversion-uuid',
    select: [
        SELECT.CONVERSION.UNIQUE_ID,
        SELECT.CONVERSION.STATUS,
        SELECT.CONVERSION.CREATED_AT
    ]
})

With Nested Data Fields

You can select specific nested fields from the data object instead of fetching the entire object:
import { GetConversion, SELECT } from '@ip2geo/sdk'

const { data, success, message } = await GetConversion({
    conversionId: 'your-conversion-uuid',
    select: [
        SELECT.CONVERSION.UNIQUE_ID,
        SELECT.DATA.CONTINENT.COUNTRY.NAME,
        SELECT.DATA.CONTINENT.COUNTRY.CODE,
        SELECT.DATA.ASN.NAME
    ]
})

// Response data structure:
// {
//     uniqueId: 'xxx',
//     data: {
//         continent: {
//             country: {
//                 name: 'United States',
//                 code: 'US'
//             }
//         },
//         asn: {
//             name: 'Cloudflare'
//         }
//     }
// }

Parameters

conversionId
string
required
The unique identifier (UUID) of the conversion to retrieve.
select
Array<SelectField>
An array of property names to return. Supports both top-level fields and nested data fields using dot notation. If not specified, all properties are returned.

Response

success
boolean
Whether the request was successful.
message
string
Response message describing the result.
code
number
HTTP status code.
data
Conversion | Partial<Conversion> | null
The conversion data. If select was specified, only the selected fields are returned. Returns null if the conversion was not found.
_req
object
Request metadata containing:
  • reqId: Unique request identifier.
  • resTime: Response time in milliseconds.

SELECT Constants

Use the SELECT.CONVERSION object for top-level field selection:
ConstantValue
SELECT.CONVERSION.IDid
SELECT.CONVERSION.UNIQUE_IDuniqueId
SELECT.CONVERSION.DATAdata
SELECT.CONVERSION.STATUSstatus
SELECT.CONVERSION.STARTED_ATstartedAt
SELECT.CONVERSION.COMPLETED_ATcompletedAt
SELECT.CONVERSION.CREATED_ATcreatedAt
SELECT.CONVERSION.CREDITEDcredited
SELECT.CONVERSION.CONVERT_ONLYconvertOnly

SELECT.DATA Constants

Use the SELECT.DATA object for nested data field selection:
ConstantValue
SELECT.DATA.IPdata.ip
SELECT.DATA.TYPEdata.type
SELECT.DATA.IS_EUdata.is_eu
SELECT.DATA.CONTINENT.NAMEdata.continent.name
SELECT.DATA.CONTINENT.CODEdata.continent.code
SELECT.DATA.CONTINENT.GEONAME_IDdata.continent.geoname_id
SELECT.DATA.CONTINENT.COUNTRY.NAMEdata.continent.country.name
SELECT.DATA.CONTINENT.COUNTRY.CODEdata.continent.country.code
SELECT.DATA.CONTINENT.COUNTRY.GEONAME_IDdata.continent.country.geoname_id
SELECT.DATA.CONTINENT.COUNTRY.PHONE_CODEdata.continent.country.phone_code
SELECT.DATA.CONTINENT.COUNTRY.CAPITALdata.continent.country.capital
SELECT.DATA.CONTINENT.COUNTRY.TLDdata.continent.country.tld
SELECT.DATA.CONTINENT.COUNTRY.SUBDIVISION.NAMEdata.continent.country.subdivision.name
SELECT.DATA.CONTINENT.COUNTRY.SUBDIVISION.CODEdata.continent.country.subdivision.code
SELECT.DATA.CONTINENT.COUNTRY.CITY.NAMEdata.continent.country.city.name
SELECT.DATA.CONTINENT.COUNTRY.CITY.GEONAME_IDdata.continent.country.city.geoname_id
SELECT.DATA.CONTINENT.COUNTRY.CITY.LATITUDEdata.continent.country.city.latitude
SELECT.DATA.CONTINENT.COUNTRY.CITY.LONGITUDEdata.continent.country.city.longitude
SELECT.DATA.CONTINENT.COUNTRY.CITY.ACCURACY_RADIUSdata.continent.country.city.accuracy_radius
SELECT.DATA.CONTINENT.COUNTRY.CITY.METRO_CODEdata.continent.country.city.metro_code
SELECT.DATA.CONTINENT.COUNTRY.CITY.POSTAL_CODEdata.continent.country.city.postal_code
SELECT.DATA.CONTINENT.COUNTRY.CITY.TIMEZONE.NAMEdata.continent.country.city.timezone.name
SELECT.DATA.CONTINENT.COUNTRY.CITY.TIMEZONE.TIME_NOWdata.continent.country.city.timezone.time_now
SELECT.DATA.CONTINENT.COUNTRY.FLAG.IMGdata.continent.country.flag.img
SELECT.DATA.CONTINENT.COUNTRY.FLAG.EMOJIdata.continent.country.flag.emoji
SELECT.DATA.CONTINENT.COUNTRY.FLAG.EMOJI_UNICODEdata.continent.country.flag.emoji_unicode
SELECT.DATA.CONTINENT.COUNTRY.CURRENCY.NAMEdata.continent.country.currency.name
SELECT.DATA.CONTINENT.COUNTRY.CURRENCY.CODEdata.continent.country.currency.code
SELECT.DATA.CONTINENT.COUNTRY.CURRENCY.SYMBOLdata.continent.country.currency.symbol
SELECT.DATA.REGISTERED_COUNTRY.NAMEdata.registered_country.name
SELECT.DATA.REGISTERED_COUNTRY.CODEdata.registered_country.code
SELECT.DATA.REGISTERED_COUNTRY.GEONAME_IDdata.registered_country.geoname_id
SELECT.DATA.ASN.NUMBERdata.asn.number
SELECT.DATA.ASN.NAMEdata.asn.name
SELECT.DATA.COMPLETION_TIME.MILISECONDSdata.completion_time.miliseconds
SELECT.DATA.COMPLETION_TIME.SECONDSdata.completion_time.seconds