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

This function allows you to retrieve a single conversion by its unique identifier, 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 { GetConversion } from '@ip2geo/sdk'

  const conversionId = 'your-conversion-uuid'

  const { data, success, message } = await GetConversion({
      conversionId: conversionId
  })
  ```

  ```ruby Ruby theme={null}
  result = Ip2Geo.get_conversion(conversion_id: 'your-conversion-uuid')

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

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

  result = ip2geo.get_conversion(conversion_id='your-conversion-uuid')

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

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

  use Ip2Geo\Ip2Geo;

  $result = Ip2Geo::getConversion(conversionId: 'your-conversion-uuid');

  // [
  //     'success' => true,
  //     'code' => 200,
  //     'message' => 'Success',
  //     'data' => [ ... ],
  //     '_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 { GetConversion, SELECT } from '@ip2geo/sdk'

  const { data, success, message } = await GetConversion({
      conversionId: 'your-conversion-uuid',
      select: [
          SELECT.COUNTRY_NAME,
          SELECT.COUNTRY_CODE,
          SELECT.ASN_NAME
      ]
  })

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

  ```ruby Ruby theme={null}
  result = Ip2Geo.get_conversion(
      conversion_id: 'your-conversion-uuid',
      select: [
          Ip2Geo.select[:COUNTRY_NAME],
          Ip2Geo.select[:COUNTRY_CODE],
          Ip2Geo.select[:ASN_NAME]
      ]
  )

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

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

  result = ip2geo.get_conversion(
      conversion_id='your-conversion-uuid',
      select=[
          ip2geo.SELECT['COUNTRY_NAME'],
          ip2geo.SELECT['COUNTRY_CODE'],
          ip2geo.SELECT['ASN_NAME'],
      ]
  )

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

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

  use Ip2Geo\Ip2Geo;

  $result = Ip2Geo::getConversion(
      conversionId: 'your-conversion-uuid',
      select: [
          Ip2Geo::SELECT['COUNTRY_NAME'],
          Ip2Geo::SELECT['COUNTRY_CODE'],
          Ip2Geo::SELECT['ASN_NAME'],
      ],
  );

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

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

    <ParamField path="conversionId" type="string" required>
      The unique identifier (UUID) of the conversion to retrieve.
    </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="Conversion | Partial<Conversion> | null">
      The conversion data. If <code>select</code> was specified, only the selected fields are returned. Returns <code>null</code> if the conversion was not found.
    </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_id" type="String" required>
      The unique identifier (UUID) of the conversion to retrieve.
    </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 conversion data. If <code>select</code> was specified, only the selected data fields are returned. Returns <code>nil</code> if the conversion was not found.
    </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_id" type="str" required>
      The unique identifier (UUID) of the conversion to retrieve.
    </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 conversion data. If <code>select</code> was specified, only the selected data fields are returned. Returns <code>None</code> if the conversion was not found.
    </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="conversionId" type="string" required>
      The unique identifier (UUID) of the conversion to retrieve.
    </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 conversion data. If <code>select</code> was specified, only the selected data fields are returned. Returns <code>null</code> if the conversion was not found.
    </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.
