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

# Ip Validation

This function allows you to validate an IP address and check if it is valid and supported by our conversion services.

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

  const ipAddress = '8.8.8.8'

  const { ip4, ip6 } = await IpValidation(ipAddress)
  ```

  ```ruby Ruby theme={null}
  result = Ip2Geo.ip_validation('8.8.8.8')

  # { ip4: true, ip6: false }
  ```

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

  result = ip2geo.ip_validation('8.8.8.8')

  # { 'ip4': True, 'ip6': False }
  ```

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

  use Ip2Geo\Ip2Geo;

  $result = Ip2Geo::ipValidation('8.8.8.8');

  // ['ip4' => true, 'ip6' => false]
  ```
</CodeGroup>

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

    <ParamField path="ipAddress" type="string" required>
      The IPv4 or IPv6 address to validate.
    </ParamField>

    ### Response

    <ResponseField name="IpValidationResult" type="object">
      An object containing validation results:

      * <code>ip4</code>: <code>boolean</code> - Whether the IP address is a valid IPv4 address.
      * <code>ip6</code>: <code>boolean</code> - Whether the IP address is a valid IPv6 address.
    </ResponseField>
  </Tab>

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

    <ParamField path="ip_address" type="String" required>
      The IPv4 or IPv6 address to validate.
    </ParamField>

    ### Response

    <ResponseField name="Hash" type="object">
      A hash containing validation results:

      * <code>:ip4</code>: <code>Boolean</code> - Whether the IP address is a valid IPv4 address.
      * <code>:ip6</code>: <code>Boolean</code> - Whether the IP address is a valid IPv6 address.
    </ResponseField>
  </Tab>

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

    <ParamField path="ip_address" type="str" required>
      The IPv4 or IPv6 address to validate.
    </ParamField>

    ### Response

    <ResponseField name="dict" type="object">
      A dict containing validation results:

      * <code>'ip4'</code>: <code>bool</code> - Whether the IP address is a valid IPv4 address.
      * <code>'ip6'</code>: <code>bool</code> - Whether the IP address is a valid IPv6 address.
    </ResponseField>
  </Tab>

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

    <ParamField path="ipAddress" type="string" required>
      The IPv4 or IPv6 address to validate.
    </ParamField>

    ### Response

    <ResponseField name="array" type="object">
      An array containing validation results:

      * <code>'ip4'</code>: <code>bool</code> - Whether the IP address is a valid IPv4 address.
      * <code>'ip6'</code>: <code>bool</code> - Whether the IP address is a valid IPv6 address.
    </ResponseField>
  </Tab>
</Tabs>
