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

# Get Conversions

This function allows you to retrieve multiple conversions by their unique identifiers in a single request, see an example below:

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

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { GetConversions } from '@ip2geo/sdk'

  const conversionIds = ['uuid-1', 'uuid-2', 'uuid-3']

  const { data, success, message } = await GetConversions({
      conversionIds: conversionIds
  })

  // Access the conversions
  console.log(data.conversions) // Array of conversion objects
  ```

  ```ruby Ruby theme={null}
  result = Ip2Geo.get_conversions(
      conversion_ids: ['uuid-1', 'uuid-2', 'uuid-3']
  )

  # Access the conversions
  puts result['data']['conversions'] # Array of conversion objects

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

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

  result = ip2geo.get_conversions(
      conversion_ids=['uuid-1', 'uuid-2', 'uuid-3']
  )

  # Access the conversions
  print(result['data']['conversions'])  # List of conversion objects

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

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

  use Ip2Geo\Ip2Geo;

  $result = Ip2Geo::getConversions(
      conversionIds: ['uuid-1', 'uuid-2', 'uuid-3'],
  );

  // Access the conversions
  print_r($result['data']['conversions']); // Array of conversion arrays

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

### With Select Fields

You can select specific fields from the conversion <code>data</code> object using the <code>select</code> parameter:

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { GetConversions, SELECT } from '@ip2geo/sdk'

  const { data, success, message } = await GetConversions({
      conversionIds: ['uuid-1', 'uuid-2'],
      select: [
          SELECT.COUNTRY_NAME,
          SELECT.COUNTRY_CODE,
          SELECT.ASN_NAME
      ]
  })

  // Response data structure:
  // {
  //     conversions: [
  //         {
  //             data: {
  //                 continent: {
  //                     country: { name: 'United States', code: 'US' }
  //                 },
  //                 asn: { name: 'Cloudflare' }
  //             }
  //         },
  //         ...
  //     ]
  // }
  ```

  ```ruby Ruby theme={null}
  result = Ip2Geo.get_conversions(
      conversion_ids: ['uuid-1', 'uuid-2'],
      select: [
          Ip2Geo.select[:COUNTRY_NAME],
          Ip2Geo.select[:COUNTRY_CODE],
          Ip2Geo.select[:ASN_NAME]
      ]
  )

  # Response data structure:
  # {
  #     'conversions' => [
  #         {
  #             'data' => {
  #                 'continent' => {
  #                     'country' => { 'name' => 'United States', 'code' => 'US' }
  #                 },
  #                 'asn' => { 'name' => 'Cloudflare' }
  #             }
  #         },
  #         ...
  #     ]
  # }
  ```

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

  result = ip2geo.get_conversions(
      conversion_ids=['uuid-1', 'uuid-2'],
      select=[
          ip2geo.SELECT['COUNTRY_NAME'],
          ip2geo.SELECT['COUNTRY_CODE'],
          ip2geo.SELECT['ASN_NAME'],
      ]
  )

  # Response data structure:
  # {
  #     'conversions': [
  #         {
  #             'data': {
  #                 'continent': {
  #                     'country': { 'name': 'United States', 'code': 'US' }
  #                 },
  #                 'asn': { 'name': 'Cloudflare' }
  #             }
  #         },
  #         ...
  #     ]
  # }
  ```

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

  use Ip2Geo\Ip2Geo;

  $result = Ip2Geo::getConversions(
      conversionIds: ['uuid-1', 'uuid-2'],
      select: [
          Ip2Geo::SELECT['COUNTRY_NAME'],
          Ip2Geo::SELECT['COUNTRY_CODE'],
          Ip2Geo::SELECT['ASN_NAME'],
      ],
  );

  // Response data structure:
  // [
  //     'conversions' => [
  //         [
  //             'data' => [
  //                 'continent' => [
  //                     'country' => ['name' => 'United States', 'code' => 'US'],
  //                 ],
  //                 'asn' => ['name' => 'Cloudflare'],
  //             ],
  //         ],
  //         ...
  //     ],
  // ]
  ```
</CodeGroup>

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

    <ParamField path="conversionIds" type="Array<string>" required>
      An array of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.
    </ParamField>

    <ParamField path="select" type="Array<SelectField>">
      Select specific data fields to return. If not specified, all data fields are returned. See <a href="/constants/select">SELECT Constants</a> for all available fields.
    </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="object | null">
      The response data containing:

      * <code>conversions</code>: Array of conversion objects (or partial objects if <code>select</code> was used)
    </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="conversion_ids" type="Array<String>" required>
      An array of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.
    </ParamField>

    <ParamField path="select" type="Array<String>">
      Select specific data fields to return. If not specified, all data fields are returned. See <a href="/constants/select">SELECT Constants</a> for all available fields.
    </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="Hash | nil">
      The response data containing:

      * <code>'conversions'</code>: Array of conversion hashes (or partial hashes if <code>select</code> was used)
    </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="conversion_ids" type="list[str]" required>
      A list of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.
    </ParamField>

    <ParamField path="select" type="list[str]">
      Select specific data fields to return. If not specified, all data fields are returned. See <a href="/constants/select">SELECT Constants</a> for all available fields.
    </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="dict | None">
      The response data containing:

      * <code>'conversions'</code>: List of conversion dicts (or partial dicts if <code>select</code> was used)
    </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="conversionIds" type="array" required>
      An array of unique identifiers (UUIDs) of the conversions to retrieve. Maximum 100 IDs per request.
    </ParamField>

    <ParamField path="select" type="array">
      Select specific data fields to return. If not specified, all data fields are returned. See <a href="/constants/select">SELECT Constants</a> for all available fields.
    </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 | null">
      The response data containing:

      * <code>'conversions'</code>: Array of conversion arrays (or partial arrays if <code>select</code> was used)
    </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>

For all available <code>SELECT</code> constants and their values, see the <a href="/constants/select">SELECT Constants</a> reference.

### Error Handling

If any of the provided conversion IDs are invalid (not valid UUIDs), the request will fail and return the list of invalid IDs:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const { data, success, message } = await GetConversions({
      conversionIds: ['valid-uuid', 'invalid-id', 'another-bad-id']
  })

  // Response:
  // {
  //     success: false,
  //     message: 'conversions.invalid-conversion-ids',
  //     data: { invalidIds: ['invalid-id', 'another-bad-id'] }
  // }
  ```

  ```ruby Ruby theme={null}
  result = Ip2Geo.get_conversions(
      conversion_ids: ['valid-uuid', 'invalid-id', 'another-bad-id']
  )

  # Response:
  # {
  #     'success' => false,
  #     'message' => 'conversions.invalid-conversion-ids',
  #     'data' => { 'invalidIds' => ['invalid-id', 'another-bad-id'] }
  # }
  ```

  ```python Python theme={null}
  result = ip2geo.get_conversions(
      conversion_ids=['valid-uuid', 'invalid-id', 'another-bad-id']
  )

  # Response:
  # {
  #     'success': False,
  #     'message': 'conversions.invalid-conversion-ids',
  #     'data': { 'invalidIds': ['invalid-id', 'another-bad-id'] }
  # }
  ```

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

  $result = Ip2Geo::getConversions(
      conversionIds: ['valid-uuid', 'invalid-id', 'another-bad-id'],
  );

  // Response:
  // [
  //     'success' => false,
  //     'message' => 'conversions.invalid-conversion-ids',
  //     'data' => ['invalidIds' => ['invalid-id', 'another-bad-id']],
  // ]
  ```
</CodeGroup>
