> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: CountryCodeFromIP

> Look up and return the ISO 3166-1 alpha-2 country code for an IPv4 address. Use for geographic segmentation in Integrate.io ETL pipelines.

## Description

Extracts the country code (ISO-3166-1 alpha2) from a given IPv4 string (dot-decimal notation).

## Syntax

`CountryCodeFromIP(ipaddress)`

## Examples

`CountryCodeFromIP('69.59.196.211')` returns 'US'

## Notes

The function uses GeoLite2 data created by MaxMind, available from [http://www.maxmind.com](https://www.maxmind.com/en/home)

## Return value datatype

String

## Impact of null value

If input is null, returns null.
