Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ip2geo.dev/llms.txt

Use this file to discover all available pages before exploring further.

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 select specific fields from the conversion data object using the select parameter:
import { GetConversion, SELECT } from '@ip2geo/sdk'

const { data, success, message } = await GetConversion({
    conversionId: 'your-conversion-uuid',
    select: [
        SELECT.COUNTRY_NAME,
        SELECT.COUNTRY_CODE,
        SELECT.ASN_NAME
    ]
})

// Response data structure:
// {
//     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>
Select specific data fields to return. If not specified, all data fields are returned. See SELECT Constants for all available fields.

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.
For all available SELECT constants and their values, see the SELECT Constants reference.