Get Conversions

This function allows you to retrieve multiple conversions by their unique identifiers in a single request. Conversions are kept for twelve months after the month they were made, then deleted, so older ones are no longer returned. Ids that are unknown, older or another project’s are left out of the answer instead of failing it, and the rows come back in no particular order, so match them by their uniqueId. See an example below:

You should authenticate/initialize Ip2Geo before using this method.

import { GetConversions } from '@ip2geo/sdk'

const conversionIds = ['uuid-1', 'uuid-2', 'uuid-3']

const { data, success, message } = await GetConversions({
    conversionIds: conversionIds
})

// Access the conversions
console.log(data.conversions) // Array of conversion objects

With Select Fields

You can select specific fields from the conversion data object using the select parameter:

import { GetConversions, SELECT } from '@ip2geo/sdk'

const { data, success, message } = await GetConversions({
    conversionIds: ['uuid-1', 'uuid-2'],
    select: [
        SELECT.COUNTRY_NAME,
        SELECT.COUNTRY_CODE,
        SELECT.ASN_NAME
    ]
})

// Response data structure (each row keeps its uniqueId, so match rows by it):
// {
//     conversions: [
//         {
//             uniqueId: '01a12452-07a0-7a3b-8c41-d2e5f6a7b8c9',
//             data: {
//                 continent: {
//                     country: { name: 'United States', code: 'us' }
//                 },
//                 asn: { name: 'Cloudflare' }
//             }
//         },
//         ...
//     ]
// }

Parameters

conversionIdsArray<string>required

An array of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.

selectArray<SelectField>

Select the fields to return. Geolocation fields, the SELECT Constants, are read under data, and the stored fields (id, uniqueId, status, startedAt, completedAt, createdAt) can be named as they are. uniqueId always comes along, so every row can be matched to its conversion. If not specified, every field is returned.

Response

successboolean

Whether the request was successful.

messagestring

Response message describing the result.

codenumber

HTTP status code.

dataobject | null

The response data containing:

  • conversions: Array of conversion objects (or partial objects if select was used)
_reqobject

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.

Error Handling

If any of the provided conversion IDs is not a UUIDv7 conversion id, the request fails and returns the list of invalid IDs:

const { data, success, message } = await GetConversions({
    conversionIds: ['valid-uuid', 'invalid-id', 'another-bad-id']
})

// Response:
// {
//     success: false,
//     message: 'One or more conversion IDs are invalid.',
//     data: { invalidIds: ['invalid-id', 'another-bad-id'] }
// }
Get Started

Convert IPs into accurate location data in milliseconds.

Sign up today and get 1,000 free monthly conversions, and discover why developers trust us for fast, reliable, and affordable IP conversions.