Skip to main content
This function allows you to list your conversions with pagination, filtering, and field selection, see an example below:
You should authenticate/initialize Ip2Geo before using this method.
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 conversions
result = 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 conversions
result = 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 conversions
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

offset
number
default:"0"
The number of conversions to skip for pagination.
limit
number
default:"50"
The maximum number of conversions to return. Maximum value is 50.
select
Array<SelectField>
Select specific data fields to return. If not specified, all data fields are returned. See SELECT Constants for all available fields.
Filter conversions by IP address.

Response

success
boolean
Whether the request was successful.
message
string
Response message describing the result.
code
number
HTTP status code.
data
object | null
The response data containing:
  • conversions: Array of conversion objects (or partial objects if select was used)
  • hasMore: Boolean indicating if there are more conversions to fetch
  • totalCount: Total number of conversions matching the query
_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.