Get Conversion
This function allows you to retrieve a single conversion by its unique identifier. Conversions are kept for twelve months after the month they were made, then deleted, so older ones are no longer returned. See an example below:
import { GetConversion } from '@ip2geo/sdk'
const conversionId = 'your-conversion-uuid'
const { data, success, message } = await GetConversion({
conversionId: conversionId
})result = Ip2Geo.get_conversion(conversion_id: 'your-conversion-uuid')
# {
# 'success' => true,
# 'code' => 200,
# 'message' => 'Success',
# 'data' => { ... },
# '_req' => { 'reqId' => '...', 'resTime' => 123 }
# }import ip2geo
result = ip2geo.get_conversion(conversion_id='your-conversion-uuid')
# {
# 'success': True,
# 'code': 200,
# 'message': 'Success',
# 'data': { ... },
# '_req': { 'reqId': '...', 'resTime': 123 }
# }<?php
use Ip2Geo\Ip2Geo;
$result = Ip2Geo::getConversion(conversionId: 'your-conversion-uuid');
// [
// 'success' => true,
// 'code' => 200,
// 'message' => 'Success',
// 'data' => [ ... ],
// '_req' => ['reqId' => '...', 'resTime' => 123],
// ]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 (uniqueId always comes along):
// {
// uniqueId: '01a12452-07a0-7a3b-8c41-d2e5f6a7b8c9',
// data: {
// continent: {
// country: {
// name: 'United States',
// code: 'us'
// }
// },
// asn: {
// name: 'Cloudflare'
// }
// }
// }result = Ip2Geo.get_conversion(
conversion_id: 'your-conversion-uuid',
select: [
Ip2Geo.select[:COUNTRY_NAME],
Ip2Geo.select[:COUNTRY_CODE],
Ip2Geo.select[:ASN_NAME]
]
)
# Response data structure (uniqueId always comes along):
# {
# 'uniqueId' => '01a12452-07a0-7a3b-8c41-d2e5f6a7b8c9',
# 'data' => {
# 'continent' => {
# 'country' => {
# 'name' => 'United States',
# 'code' => 'us'
# }
# },
# 'asn' => {
# 'name' => 'Cloudflare'
# }
# }
# }import ip2geo
result = ip2geo.get_conversion(
conversion_id='your-conversion-uuid',
select=[
ip2geo.SELECT['COUNTRY_NAME'],
ip2geo.SELECT['COUNTRY_CODE'],
ip2geo.SELECT['ASN_NAME'],
]
)
# Response data structure (uniqueId always comes along):
# {
# 'uniqueId': '01a12452-07a0-7a3b-8c41-d2e5f6a7b8c9',
# 'data': {
# 'continent': {
# 'country': {
# 'name': 'United States',
# 'code': 'us'
# }
# },
# 'asn': {
# 'name': 'Cloudflare'
# }
# }
# }<?php
use Ip2Geo\Ip2Geo;
$result = Ip2Geo::getConversion(
conversionId: 'your-conversion-uuid',
select: [
Ip2Geo::SELECT['COUNTRY_NAME'],
Ip2Geo::SELECT['COUNTRY_CODE'],
Ip2Geo::SELECT['ASN_NAME'],
],
);
// Response data structure (uniqueId always comes along):
// [
// 'uniqueId' => '01a12452-07a0-7a3b-8c41-d2e5f6a7b8c9',
// 'data' => [
// 'continent' => [
// 'country' => [
// 'name' => 'United States',
// 'code' => 'us',
// ],
// ],
// 'asn' => [
// 'name' => 'Cloudflare',
// ],
// ],
// ]Parameters
conversionIdstringrequiredThe unique identifier (UUID) of the conversion to retrieve.
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
successbooleanWhether the request was successful.
messagestringResponse message describing the result.
codenumberHTTP status code.
dataConversion | Partial<Conversion> | nullThe conversion data. If select was specified, only the selected fields are returned. Returns null if the conversion was not found.
_reqobjectRequest metadata containing:
reqId: Unique request identifier.resTime: Response time in milliseconds.
Parameters
conversion_idStringrequiredThe unique identifier (UUID) of the conversion to retrieve.
selectArray<String>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
successBooleanWhether the request was successful.
messageStringResponse message describing the result.
codeIntegerHTTP status code.
dataHash | nilThe conversion data. If select was specified, only the selected data fields are returned. Returns nil if the conversion was not found.
_reqHashRequest metadata containing:
‘reqId’: Unique request identifier.‘resTime’: Response time in milliseconds.
Parameters
conversion_idstrrequiredThe unique identifier (UUID) of the conversion to retrieve.
selectlist[str]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
successboolWhether the request was successful.
messagestrResponse message describing the result.
codeintHTTP status code.
datadict | NoneThe conversion data. If select was specified, only the selected data fields are returned. Returns None if the conversion was not found.
_reqdictRequest metadata containing:
‘reqId’: Unique request identifier.‘resTime’: Response time in milliseconds.
Parameters
conversionIdstringrequiredThe unique identifier (UUID) of the conversion to retrieve.
selectarraySelect 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
successboolWhether the request was successful.
messagestringResponse message describing the result.
codeintHTTP status code.
dataarray | nullThe conversion data. If select was specified, only the selected data fields are returned. Returns null if the conversion was not found.
_reqarrayRequest metadata containing:
‘reqId’: Unique request identifier.‘resTime’: Response time in milliseconds.
For all available SELECT constants and their values, see the SELECT Constants reference.