Skip to main content
This function allows you to convert multiple IP addresses in a single request, making it efficient for batch processing. You can provide an array of IP addresses, and the function will return their corresponding geolocation data.
You should authenticate/initialize Ip2Geo before using this method.
import { ConvertIPs } from '@ip2geo/sdk'

const ipAddresses = [
    '8.8.8.8',
    '8.8.4.4',
    '1.1.1.1',
    '9.9.9.9',
    '4.4.4.4',
    '3.3.3.3'
]

const { data, success, message } = await ConvertIPs({
    ips: ipAddresses
})

Parameters

ips
Array<string>
required
An array of IPv4 or IPv6 addresses to convert. Maximum 5000 IPs per request.
convertOnly
boolean
default:"false"
If set to true, doesn’t store conversion data and charges $0.001 per conversion instead of $0.0005. Defaults to false (full data storage).

Response

success
boolean
Whether the request was successful.
message
string
Response message describing the result.
code
number
HTTP status code.
data
Array<{ ip: string, conversion: Ip | null }>
An array of conversion results. Each item contains:
  • ip: The IP address that was converted.
  • conversion: The geolocation data for the IP (see Ip Interface). Returns null if the conversion failed for that IP Response Interface.
_req
object
Request metadata containing:
  • reqId: Unique request identifier.
  • resTime: Response time in milliseconds.