> ## 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.

# Bulk Convert IP's

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.

<Warning>
  You should authenticate/initialize <a href="/sdk/init">Ip2Geo</a> before using this method.
</Warning>

<CodeGroup>
  ```typescript TypeScript theme={null}
  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
  })
  ```

  ```ruby Ruby theme={null}
  ip_addresses = [
      '8.8.8.8',
      '8.8.4.4',
      '1.1.1.1',
      '9.9.9.9',
      '4.4.4.4',
      '3.3.3.3'
  ]

  result = Ip2Geo.convert_ips(ips: ip_addresses)

  # {
  #     'success' => true,
  #     'code' => 200,
  #     'message' => 'Success',
  #     'data' => [
  #         { 'ip' => '8.8.8.8', 'conversion' => { ... } },
  #         { 'ip' => '8.8.4.4', 'conversion' => { ... } },
  #         ...
  #     ],
  #     '_req' => { 'reqId' => '...', 'resTime' => 123 }
  # }
  ```

  ```python Python theme={null}
  import ip2geo

  ip_addresses = [
      '8.8.8.8',
      '8.8.4.4',
      '1.1.1.1',
      '9.9.9.9',
      '4.4.4.4',
      '3.3.3.3',
  ]

  result = ip2geo.convert_ips(ips=ip_addresses)

  # {
  #     'success': True,
  #     'code': 200,
  #     'message': 'Success',
  #     'data': [
  #         { 'ip': '8.8.8.8', 'conversion': { ... } },
  #         { 'ip': '8.8.4.4', 'conversion': { ... } },
  #         ...
  #     ],
  #     '_req': { 'reqId': '...', 'resTime': 123 }
  # }
  ```

  ```php PHP theme={null}
  <?php

  use Ip2Geo\Ip2Geo;

  $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',
  ];

  $result = Ip2Geo::convertIps(ips: $ipAddresses);

  // [
  //     'success' => true,
  //     'code' => 200,
  //     'message' => 'Success',
  //     'data' => [
  //         ['ip' => '8.8.8.8', 'conversion' => [ ... ]],
  //         ['ip' => '8.8.4.4', 'conversion' => [ ... ]],
  //         ...
  //     ],
  //     '_req' => ['reqId' => '...', 'resTime' => 123],
  // ]
  ```
</CodeGroup>

<Tabs>
  <Tab title="TypeScript">
    ### Parameters

    <ParamField path="ips" type="Array<string>" required>
      An array of IPv4 or IPv6 addresses to convert. Maximum 5000 IPs per request.
    </ParamField>

    ### Response

    <ResponseField name="success" type="boolean">
      Whether the request was successful.
    </ResponseField>

    <ResponseField name="message" type="string">
      Response message describing the result.
    </ResponseField>

    <ResponseField name="code" type="number">
      HTTP status code.
    </ResponseField>

    <ResponseField name="data" type="Array<{ ip: string, conversion: Ip | null }>">
      An array of conversion results. Each item contains:

      * <code>ip</code>: The IP address that was converted.
      * <code>conversion</code>: The geolocation data for the IP (see <a href="/interfaces/ip">Ip Interface</a>). Returns <code>null</code> if the conversion failed for that IP <a href="/interfaces/conversion">Response Interface</a>.
    </ResponseField>

    <ResponseField name="_req" type="object">
      Request metadata containing:

      * <code>reqId</code>: Unique request identifier.
      * <code>resTime</code>: Response time in milliseconds.
    </ResponseField>
  </Tab>

  <Tab title="Ruby">
    ### Parameters

    <ParamField path="ips" type="Array<String>" required>
      An array of IPv4 or IPv6 addresses to convert. Maximum 5000 IPs per request.
    </ParamField>

    ### Response

    <ResponseField name="success" type="Boolean">
      Whether the request was successful.
    </ResponseField>

    <ResponseField name="message" type="String">
      Response message describing the result.
    </ResponseField>

    <ResponseField name="code" type="Integer">
      HTTP status code.
    </ResponseField>

    <ResponseField name="data" type="Array<Hash>">
      An array of conversion results. Each item contains:

      * <code>'ip'</code>: The IP address that was converted.
      * <code>'conversion'</code>: The geolocation data for the IP (see <a href="/interfaces/ip">Ip Interface</a>). Returns <code>nil</code> if the conversion failed for that IP <a href="/interfaces/conversion">Response Interface</a>.
    </ResponseField>

    <ResponseField name="_req" type="Hash">
      Request metadata containing:

      * <code>'reqId'</code>: Unique request identifier.
      * <code>'resTime'</code>: Response time in milliseconds.
    </ResponseField>
  </Tab>

  <Tab title="Python">
    ### Parameters

    <ParamField path="ips" type="list[str]" required>
      A list of IPv4 or IPv6 addresses to convert. Maximum 5000 IPs per request.
    </ParamField>

    ### Response

    <ResponseField name="success" type="bool">
      Whether the request was successful.
    </ResponseField>

    <ResponseField name="message" type="str">
      Response message describing the result.
    </ResponseField>

    <ResponseField name="code" type="int">
      HTTP status code.
    </ResponseField>

    <ResponseField name="data" type="list[dict]">
      A list of conversion results. Each item contains:

      * <code>'ip'</code>: The IP address that was converted.
      * <code>'conversion'</code>: The geolocation data for the IP (see <a href="/interfaces/ip">Ip Interface</a>). Returns <code>None</code> if the conversion failed for that IP <a href="/interfaces/conversion">Response Interface</a>.
    </ResponseField>

    <ResponseField name="_req" type="dict">
      Request metadata containing:

      * <code>'reqId'</code>: Unique request identifier.
      * <code>'resTime'</code>: Response time in milliseconds.
    </ResponseField>
  </Tab>

  <Tab title="PHP">
    ### Parameters

    <ParamField path="ips" type="array" required>
      An array of IPv4 or IPv6 addresses to convert. Maximum 5000 IPs per request.
    </ParamField>

    ### Response

    <ResponseField name="success" type="bool">
      Whether the request was successful.
    </ResponseField>

    <ResponseField name="message" type="string">
      Response message describing the result.
    </ResponseField>

    <ResponseField name="code" type="int">
      HTTP status code.
    </ResponseField>

    <ResponseField name="data" type="array">
      An array of conversion results. Each item contains:

      * <code>'ip'</code>: The IP address that was converted.
      * <code>'conversion'</code>: The geolocation data for the IP (see <a href="/interfaces/ip">Ip Interface</a>). Returns <code>null</code> if the conversion failed for that IP <a href="/interfaces/conversion">Response Interface</a>.
    </ResponseField>

    <ResponseField name="_req" type="array">
      Request metadata containing:

      * <code>'reqId'</code>: Unique request identifier.
      * <code>'resTime'</code>: Response time in milliseconds.
    </ResponseField>
  </Tab>
</Tabs>
