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 multiple conversions by their unique identifiers in a single request, 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:
// {
// conversions: [
// {
// data: {
// continent: {
// country: { name: 'United States', code: 'US' }
// },
// asn: { name: 'Cloudflare' }
// }
// },
// ...
// ]
// }
TypeScript
Ruby
Python
PHP
Parameters
An array of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.
Select specific data fields to return. If not specified, all data fields are returned. See SELECT Constants for all available fields. Response
Whether the request was successful.
Response message describing the result.
The response data containing:
conversions: Array of conversion objects (or partial objects if select was used)
Request metadata containing:
reqId: Unique request identifier.
resTime: Response time in milliseconds.
Parameters
An array of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.
Select specific data fields to return. If not specified, all data fields are returned. See SELECT Constants for all available fields. Response
Whether the request was successful.
Response message describing the result.
The response data containing:
‘conversions’: Array of conversion hashes (or partial hashes if select was used)
Request metadata containing:
‘reqId’: Unique request identifier.
‘resTime’: Response time in milliseconds.
Parameters
A list of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.
Select specific data fields to return. If not specified, all data fields are returned. See SELECT Constants for all available fields. Response
Whether the request was successful.
Response message describing the result.
The response data containing:
‘conversions’: List of conversion dicts (or partial dicts if select was used)
Request metadata containing:
‘reqId’: Unique request identifier.
‘resTime’: Response time in milliseconds.
Parameters
An array of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.
Select specific data fields to return. If not specified, all data fields are returned. See SELECT Constants for all available fields. Response
Whether the request was successful.
Response message describing the result.
The response data containing:
‘conversions’: Array of conversion arrays (or partial arrays if select was used)
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 are invalid (not valid UUIDs), the request will fail and return the list of invalid IDs:
const { data, success, message } = await GetConversions({
conversionIds: ['valid-uuid', 'invalid-id', 'another-bad-id']
})
// Response:
// {
// success: false,
// message: 'conversions.invalid-conversion-ids',
// data: { invalidIds: ['invalid-id', 'another-bad-id'] }
// }