Skip to main content
POST
/
convert
Ip2Geo - Bulk Convert IPs
curl --request POST \
  --url https://api.ip2geo.dev/convert \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "ips": [
    "<string>"
  ],
  "convertOnly": false
}
'
{
  "success": true,
  "message": "<string>",
  "code": 123,
  "data": [
    {
      "ip": "<string>",
      "conversion": {
        "ip": "<string>",
        "type": "ipv4",
        "is_eu": true,
        "continent": {
          "name": "<string>",
          "code": "<string>",
          "geoname_id": 123,
          "country": {
            "name": "<string>",
            "code": "<string>",
            "geoname_id": 123,
            "phone_code": "<string>",
            "capital": "<string>",
            "tld": "<string>",
            "subdivision": {
              "name": "<string>",
              "code": "<string>"
            },
            "city": {
              "name": "<string>",
              "geoname_id": 123,
              "latitude": 123,
              "longitude": 123,
              "accuracy_radius": 123,
              "metro_code": 123,
              "postal_code": "<string>",
              "timezone": {
                "name": "<string>",
                "time_now": "<string>"
              }
            },
            "flag": {
              "img": "<string>",
              "emoji": "<string>",
              "emoji_unicode": "<string>"
            },
            "currency": {
              "name": "<string>",
              "code": "<string>",
              "symbol": "<string>"
            }
          }
        },
        "registered_country": {
          "name": "<string>",
          "code": "<string>",
          "geoname_id": 123
        },
        "asn": {
          "number": 123,
          "name": "<string>"
        },
        "completion_time": {
          "miliseconds": 123,
          "seconds": 123
        }
      }
    }
  ],
  "_req": {
    "reqId": "<string>",
    "resTime": 123
  }
}

Authorizations

x-api-key
string
header
required

Use your Ip2Geo secret key (i2g_sk_...) for server-side requests, or public key (i2g_pk_...) for client-side requests. Example: x-api-key: i2g_sk_abc123.

Body

application/json
ips
string[]
required

Array of IPv4 or IPv6 addresses to lookup.

Maximum array length: 5000
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

Successful geolocation lookup.

success
boolean
required

Whether the request was successful.

message
string
required

Response message.

code
integer
required

HTTP status code.

data
object[]
required
_req
object
required