Skip to main content

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 convert a single IP address into its corresponding geolocation data using, see an example below:
You should authenticate/initialize Ip2Geo before using this method.
import { ConvertIP } from '@ip2geo/sdk'

const ipAddress = '8.8.8.8'

const { data, success, message } = await ConvertIP({
    ip: ipAddress
})

Parameters

ip
string
required
The IPv4 or IPv6 address to convert.

Response

success
boolean
Whether the request was successful.
message
string
Response message describing the result.
code
number
HTTP status code.
data
Ip | null
The geolocation data for the IP address. See Ip Interface for details. Returns null if the conversion failed, read more about IP Response Interface.
_req
object
Request metadata containing:
  • reqId: Unique request identifier.
  • resTime: Response time in milliseconds.