How to Add IP Geolocation to n8n
Look up any IP from an n8n workflow with the built-in HTTP Request node: one IP, a batch, or every new signup.
You can add IP geolocation to n8n today with the HTTP Request node that ships with it; no community node needed. Store your IPWho key once as a Header Auth credential, then look up one IP, a batch of IPs, or every new signup. Step 4 is a ready-made workflow that adds country, currency and timezone to each signup.
No code needed. Every step uses n8n's built-in nodes and expressions. Field paths come from the full response reference. Prefer code? The other guides use Python, and there are SDKs in 10+ languages.
1Store your API key as a Header Auth credential.
Create a free account here: 2,000 lookups/day, no card. In n8n, open Credentials → Create credential → Header Auth and enter:
Credential type Header Auth
Name X-API-Key
Value sk.xxx (your IPWho API key)
n8n stores the key encrypted and sends it as an X-API-Key header on every call. Don't put it in the URL: ?apiKey= works, but the key then shows up in execution logs and anywhere the URL is shared.
2Look up one IP with the HTTP Request node.
Add an HTTP Request node after whatever gives you the IP (a webhook, a form, a database row). Set it up like this, where ip is the field holding the address:
Method GET
URL https://api.ipwho.org/ip/{{ $json.ip }}
Authentication Generic Credential Type
Generic Auth Type Header Auth → your IPWho credential
The response wraps everything in data, grouped into geoLocation, timezone, currency, connection and security. Trimmed, it looks like this (our docs' sample IP):
{
"success": true,
"data": {
"ip": "76.102.11.203",
"geoLocation": {
"country": "United States",
"countryCode": "US",
"region": "California",
"regionCode": "CA",
"city": "Los Altos",
"postal_Code": "94022",
"is_in_eu": false
},
"timezone": { "time_zone": "America/Los_Angeles", "abbr": "PST" },
"currency": { "code": "USD", "symbol": "$", "name": "US Dollar" },
"connection": { "asn_number": 7922, "isp": "Comcast Cable", "connection_type": "Cable/DSL" }
}
}
Use these expressions in the next node. Keep the field names exactly as the API sends them, including the mixed case (postal_Code, time_zone). region and city can be null for some IPs; country is the most reliable level.
{{ $json.data.geoLocation.country }} // "United States"
{{ $json.data.currency.code }} // "USD"
{{ $json.data.timezone.time_zone }} // "America/Los_Angeles"
{{ $json.data.geoLocation.city ?? '' }} // city can be null3Look up many IPs in one request.
The /bulk endpoint takes a comma-separated list of IPs and returns one result per IP in data.responseArray. When your IPs arrive as separate n8n items, combine them into one list, call the endpoint once, then split the results back into items:
1. Aggregate Individual Fields → Input Field Name: ip
2. HTTP Request Method: GET
URL: https://api.ipwho.org/bulk/{{ $json.ip.join(',') }}
Authentication: your IPWho Header Auth credential
3. Split Out Fields To Split Out: data.responseArray
Each result has the same geoLocation / connection shape as a single lookup. For long lists, put a Loop Over Items node (batch size 100) in front so each request stays at 100 IPs or fewer, as in the bulk lookup guide.
4Import the signup-enrichment workflow.
The ready-made workflow takes a new signup (email + IP), looks up the IP and returns the signup with country, region, city, EU flag, currency, timezone and connection type added. Signups with no IP, or a failed lookup, are flagged rather than dropped. It contains no API key.
- Download ipwho-enrich-signups.json. In n8n, create a workflow, open the … menu and choose Import → From file (older versions: Import from File).
- Open the Look up IP with IPWho node and select the Header Auth credential from step 1.
- Click Execute workflow. The manual trigger sends a sample signup, so you can check the output without a webhook.
- Activate the workflow and have your app POST each new signup to the webhook. Send the visitor's IP as your app saw it (for example from
CF-Connecting-IPorX-Forwarded-For), not the IP of your own server.
curl -X POST "https://YOUR-N8N-HOST/webhook/ipwho-enrich-signup" \
-H "Content-Type: application/json" \
-d '{"email": "jane@example.com", "ip": "76.102.11.203"}'The webhook replies with the enriched signup. For the sample IP it should look like this (built from the sample response above):
{
"email": "jane@example.com",
"ip": "76.102.11.203",
"country": "United States",
"countryCode": "US",
"region": "California",
"regionCode": "CA",
"city": "Los Altos",
"is_in_eu": false,
"currency": "USD",
"time_zone": "America/Los_Angeles",
"connection_type": "Cable/DSL",
"ipwho_status": "ok"
}
To keep the result, add a node after Add location fields that writes to your CRM, database or sheet. connection_type is one of Cable/DSL, Cellular, Corporate or Satellite, or null. Corporate covers cloud servers as well as offices and corporate VPNs, so treat it as context, not a reason to reject a signup.
Start with a free API key
Free tier: 2,000 lookups/day, no card. Paid plans from $2.50/month. Full field reference here.