List Conversions
This function allows you to list your conversions with pagination, filtering, and field selection. 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 { ListConversions } from '@ip2geo/sdk'
const { data, success, message } = await ListConversions()result = Ip2Geo.list_conversions
# {
# 'success' => true,
# 'code' => 200,
# 'message' => 'Success',
# 'data' => {
# 'conversions' => [...],
# 'hasMore' => true,
# 'totalCount' => 100
# },
# '_req' => { 'reqId' => '...', 'resTime' => 123 }
# }import ip2geo
result = ip2geo.list_conversions()
# {
# 'success': True,
# 'code': 200,
# 'message': 'Success',
# 'data': {
# 'conversions': [...],
# 'hasMore': True,
# 'totalCount': 100
# },
# '_req': { 'reqId': '...', 'resTime': 123 }
# }<?php
use Ip2Geo\Ip2Geo;
$result = Ip2Geo::listConversions();
// [
// 'success' => true,
// 'code' => 200,
// 'message' => 'Success',
// 'data' => [
// 'conversions' => [...],
// 'hasMore' => true,
// 'totalCount' => 100,
// ],
// '_req' => ['reqId' => '...', 'resTime' => 123],
// ]With Pagination
You can paginate through conversions using offset and limit:
import { ListConversions } from '@ip2geo/sdk'
const { data, success, message } = await ListConversions({
offset: 0,
limit: 20
})
// Access pagination info
console.log(data.conversions) // Array of conversions
console.log(data.hasMore) // true if there are more conversions
console.log(data.totalCount) // Total number of conversionsresult = Ip2Geo.list_conversions(offset: 0, limit: 20)
# Access pagination info
puts result['data']['conversions'] # Array of conversions
puts result['data']['hasMore'] # true if there are more conversions
puts result['data']['totalCount'] # Total number of conversionsresult = ip2geo.list_conversions(offset=0, limit=20)
# Access pagination info
print(result['data']['conversions']) # List of conversions
print(result['data']['hasMore']) # True if there are more conversions
print(result['data']['totalCount']) # Total number of conversions<?php
$result = Ip2Geo::listConversions(offset: 0, limit: 20);
// Access pagination info
print_r($result['data']['conversions']); // Array of conversions
var_dump($result['data']['hasMore']); // true if there are more conversions
echo $result['data']['totalCount']; // Total number of conversionsWith IP Search
Filter conversions by IP address:
import { ListConversions } from '@ip2geo/sdk'
const { data, success, message } = await ListConversions({
ipSearch: '8.8.8.8'
})result = Ip2Geo.list_conversions(ip_search: '8.8.8.8')result = ip2geo.list_conversions(ip_search='8.8.8.8')<?php
$result = Ip2Geo::listConversions(ipSearch: '8.8.8.8');With Select Fields
Select specific fields from the conversion data object:
import { ListConversions, SELECT } from '@ip2geo/sdk'
const { data, success, message } = await ListConversions({
select: [
SELECT.COUNTRY_NAME,
SELECT.COUNTRY_CODE,
SELECT.ASN_NAME
]
})result = Ip2Geo.list_conversions(
select: [
Ip2Geo.select[:COUNTRY_NAME],
Ip2Geo.select[:COUNTRY_CODE],
Ip2Geo.select[:ASN_NAME]
]
)result = ip2geo.list_conversions(
select=[
ip2geo.SELECT['COUNTRY_NAME'],
ip2geo.SELECT['COUNTRY_CODE'],
ip2geo.SELECT['ASN_NAME'],
]
)<?php
$result = Ip2Geo::listConversions(
select: [
Ip2Geo::SELECT['COUNTRY_NAME'],
Ip2Geo::SELECT['COUNTRY_CODE'],
Ip2Geo::SELECT['ASN_NAME'],
],
);Parameters
offsetnumberdefault: 0The number of conversions to skip for pagination.
limitnumberdefault: 50The maximum number of conversions to return. Maximum value is 50.
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.
ipSearchstringFilter conversions by IP address.
Response
successbooleanWhether the request was successful.
messagestringResponse message describing the result.
codenumberHTTP status code.
dataobject | nullThe response data containing:
conversions: Array of conversion objects (or partial objects ifselectwas used)hasMore: Boolean indicating if there are more conversions to fetchtotalCount: Total number of conversions matching the query
_reqobjectRequest metadata containing:
reqId: Unique request identifier.resTime: Response time in milliseconds.
Parameters
offsetIntegerdefault: 0The number of conversions to skip for pagination.
limitIntegerdefault: 50The maximum number of conversions to return. Maximum value is 50.
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.
ip_searchStringFilter conversions by IP address.
Response
successBooleanWhether the request was successful.
messageStringResponse message describing the result.
codeIntegerHTTP status code.
dataHash | nilThe response data containing:
‘conversions’: Array of conversion hashes (or partial hashes ifselectwas used)‘hasMore’: Boolean indicating if there are more conversions to fetch‘totalCount’: Total number of conversions matching the query
_reqHashRequest metadata containing:
‘reqId’: Unique request identifier.‘resTime’: Response time in milliseconds.
Parameters
offsetintdefault: 0The number of conversions to skip for pagination.
limitintdefault: 50The maximum number of conversions to return. Maximum value is 50.
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.
ip_searchstrFilter conversions by IP address.
Response
successboolWhether the request was successful.
messagestrResponse message describing the result.
codeintHTTP status code.
datadict | NoneThe response data containing:
‘conversions’: List of conversion dicts (or partial dicts ifselectwas used)‘hasMore’: Boolean indicating if there are more conversions to fetch‘totalCount’: Total number of conversions matching the query
_reqdictRequest metadata containing:
‘reqId’: Unique request identifier.‘resTime’: Response time in milliseconds.
Parameters
offsetintdefault: 0The number of conversions to skip for pagination.
limitintdefault: 50The maximum number of conversions to return. Maximum value is 50.
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.
ipSearchstringFilter conversions by IP address.
Response
successboolWhether the request was successful.
messagestringResponse message describing the result.
codeintHTTP status code.
dataarray | nullThe response data containing:
‘conversions’: Array of conversion arrays (or partial arrays ifselectwas used)‘hasMore’: Boolean indicating if there are more conversions to fetch‘totalCount’: Total number of conversions matching the query
_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.