Locate an IP address
An IP address alone tells you almost nothing useful until you resolve it, and resolving it well means more than a country flag. This endpoint turns a raw IP into a place — country, region, city and the network operator behind it — so pricing, compliance and fraud logic can run on facts instead of guesses.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
An address without a place is just a number
IP addresses are assigned in blocks to internet service providers, hosting companies and enterprises, and those blocks are registered with regional authorities that publish who holds what and, broadly, where. Geolocation works by matching an IP against that registration data plus routing and network signals, producing a best estimate of where the connection is actually coming from without ever contacting the visitor directly.
What you get back
The response includes country, region or state, city where resolvable, and the autonomous system number (ASN) that identifies the network operator — the difference between a residential ISP, a mobile carrier, a corporate network or a hosting provider. City-level results are naturally less precise than country-level ones, since they depend on how granular the underlying registration and routing data happens to be for that particular block, and that granularity varies a lot by region.
Why ASN matters as much as the map pin
Two IPs can sit in the same city and mean very different things depending on their ASN. One might belong to a home broadband provider, another to a cloud hosting range with thousands of unrelated tenants behind it. Surfacing the ASN alongside the location lets you build rules that a country field alone simply can't support, like distinguishing a real household from a rented server claiming the same city.
From registries to real-time routing
The regional internet registries that allocate IP blocks have existed since the early internet, originally created to keep the finite address space from running out chaotically as networks multiplied. That same registration structure, combined with how traffic is actually routed today, is what makes automated geolocation possible at request time rather than through some manual lookup against a static list.
Built to slot into existing pipelines
Call the endpoint, get a task_id, and receive the result on your signed webhook or a signed link valid 24 hours, depending on which fits your integration. It's meant to sit inline with signup flows, checkout, or logging pipelines without becoming the bottleneck in any of them, resolving in the background while the rest of the request continues normally.
What you can do with it
Localized pricing and currency
Show prices in the visitor's local currency and language by resolving country and region before the page renders content.
Content and licensing restrictions
Enforce region-based access rules for content or offers that are only licensed in certain countries.
Fraud and risk context
Compare a shipping address against the resolved IP location to flag orders worth a second look.
Traffic analytics by network
Segment analytics by ASN to separate residential visitors from hosting or corporate network traffic.
FAQ
How accurate is IP geolocation?
Country-level results are generally reliable because IP blocks are registered by country; city-level results are an estimate and can be off, especially for mobile networks and VPNs, since IPs move and registration data isn't always current.
Is this ip geolocation api free to use?
There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.
Does it work for IPv6 addresses?
Yes, both IPv4 and IPv6 addresses are resolved through the same endpoint.
What is ASN and why is it included?
ASN identifies the network operator that owns the IP block, which tells you whether traffic is coming from a home connection, a mobile carrier, a business network or a hosting provider — useful context that a city name alone doesn't give you.
Can I geolocate many IPs in bulk?
Each call resolves one IP; for large batches, submit one request per IP and let the asynchronous model handle the volume in parallel.
How do I get the result back?
You get a task_id immediately, and the resolved location arrives via your signed webhook or a signed link valid for 24 hours.
Do you store the IPs I send?
No. Data is deleted after the retention period expires and is never used for training.
What happens if a lookup fails?
It's retried automatically up to three times before returning a clear error, and you're never charged for a request that didn't complete.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/verify/ip-geo \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"items":["valor-1","valor-2"]}'const res = await fetch("https://api.kit.forhosting.com/verify/ip-geo", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"items": [
"valor-1",
"valor-2"
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/verify/ip-geo",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"items": [
"valor-1",
"valor-2"
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/verify/ip-geo", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"items":["valor-1","valor-2"]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"items":["valor-1","valor-2"]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/verify/ip-geo", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"items": [
"valor-1",
"valor-2"
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "verify.ip_geo",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |