One GET request returns a full profile for any IP as JSON. Copy the command and swap in your key.
curl "https://api.ipstack.com/134.201.250.155?access_key=YOUR_KEY"{ "ip": "134.201.250.155", "type": "ipv4", "country_code": "US", "country_name": "United States", "region_name": "California", "city": "Los Angeles", "zip": "90013", "latitude": 34.0453, "longitude": -118.2413, "time_zone": { "id": "America/Los_Angeles" }, "currency": { "code": "USD", "symbol": "$" }, "connection": { "asn": 174, "isp": "Cogent Communications" }, "security": { "is_proxy": false, "threat_level": "low" } }
Location fields come with the free plan. Time zone, currency, connection, and security depend on your plan.
Every field the API returns is listed with its type, an example, and the plan that includes it.
The IP geolocation API page shows what teams build with each field.
{ "ip": "134.201.250.155", "type": "ipv4", "continent_code": "NA", "continent_name": "North America", "country_code": "US", "country_name": "United States", "region_code": "CA", "region_name": "California", "city": "Los Angeles", "zip": "90013", "latitude": 34.0453, "longitude": -118.2413, "location": { "capital": "Washington D.C.", "languages": [{"code": "en", "name": "English"}], "country_flag_emoji": "🇺🇸", "calling_code": "1", "is_eu": false }, "time_zone": { "id": "America/Los_Angeles", "current_time": "2026-08-19T06:22:04-07:00", "gmt_offset": -25200, "code": "PDT", "is_daylight_saving": true }, "currency": { "code": "USD", "name": "US Dollar", "plural": "US dollars", "symbol": "$" }, "connection": { "asn": 174, "isp": "Cogent Communications", "connection_type": "corporate" }, "security": { "is_proxy": false, "proxy_type": null, "is_crawler": false, "is_tor": false, "threat_level": "low", "threat_types": null } }
| Field | Type | Example | Description | Module |
|---|---|---|---|---|
| Location | ||||
| ip | string | "134.201.250.155" | The address that was resolved | CORE |
| type | string | "ipv4" | ipv4 or ipv6 | CORE |
| country_code / country_name | string | "US" · "United States" | ISO 3166-1 country | CORE |
| region_code / region_name | string | "CA" · "California" | State, province, or region | CORE |
| city / zip | string | "Los Angeles" · "90013" | Resolved city and postal code | CORE |
| latitude / longitude | number | 34.0453 · -118.2413 | Coordinates of the area centroid | CORE |
| location.capital | string | "Washington D.C." | Capital of the resolved country | CORE |
| location.languages | array | [{"code":"en"}] | Official languages with ISO codes | CORE |
| location.country_flag_emoji | string | "🇺🇸" | Flag ready for UI display | CORE |
| location.calling_code | string | "1" | International dialing prefix | CORE |
| location.is_eu | boolean | false | EU membership flag for consent logic | CORE |
| Time zone | ||||
| time_zone.id | string | "America/Los_Angeles" | IANA timezone identifier | PAID PLANS |
| time_zone.current_time | string | "2026-08-19T06:22:04-07:00" | Local time at the address now | PAID PLANS |
| time_zone.gmt_offset | number | -25200 | Offset from GMT in seconds | PAID PLANS |
| Currency | ||||
| currency.code / symbol | string | "USD" · "$" | ISO 4217 currency for price display | PAID PLANS |
| currency.name / plural | string | "US Dollar" · "US dollars" | Currency names for checkout copy | PAID PLANS |
| Connection | ||||
| connection.asn | number | 174 | Autonomous system number | PAID PLANS |
| connection.isp | string | "Cogent Communications" | Operator serving the address | PAID PLANS |
| connection.connection_type | string | "corporate" | Line type behind the address | PAID PLANS |
| Security | ||||
| security.is_proxy / proxy_type | boolean / string | false · null | Proxy detection and classification | PROFESSIONAL+ |
| security.is_tor / is_crawler | boolean | false · false | Tor exit and bot identification | PROFESSIONAL+ |
| security.threat_level / threat_types | string / array | "low" · null | Aggregated risk scoring | PROFESSIONAL+ |
Module availability follows your plan; details are on the pricing page.
Leave the IP out of the URL and the API resolves the caller for you.
# Resolve the caller's own IP curl "https://api.ipstack.com/check?access_key=YOUR_KEY"
// Server-side: resolve the visitor behind the current request const res = await fetch( `https://api.ipstack.com/check?access_key=${process.env.IPSTACK_KEY}` ); const visitor = await res.json(); console.log(visitor.ip, visitor.city);
Calling /check from browser JavaScript exposes your key in the page source.
The step-by-step IPstack API guide walks through keeping your key server-side.
JSON needs no format parameter. Add output=xml or callback= when a system expects something else.
curl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY"curl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY&output=xml"curl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY&callback=myHandler"| Format | Parameter | When to use it |
|---|---|---|
| JSON | none (default) | Everything modern: apps, services, pipelines, agents |
| XML | output=xml | Legacy systems and XML-native tooling |
| JSONP | callback=myHandler | Old browser code that cannot use CORS |
Every sample below runs the lookup and extracts the fields, so you can paste it straight into your project.
// "🇺🇸 Los Angeles, US" const geo = await (await fetch( `https://api.ipstack.com/${ip}?access_key=${process.env.IPSTACK_KEY}` )).json(); const label = `${geo.location.country_flag_emoji} ${geo.city}, ${geo.country_code}`; console.log(label);
# "🇺🇸 Los Angeles, US" import os, requests geo = requests.get( f"https://api.ipstack.com/{ip}", params={"access_key": os.environ["IPSTACK_KEY"]} ).json() label = f"{geo['location']['country_flag_emoji']} {geo['city']}, {geo['country_code']}" print(label)
// "🇺🇸 Los Angeles, US" $geo = json_decode(file_get_contents( "https://api.ipstack.com/$ip?access_key=$key" ), true); echo $geo["location"]["country_flag_emoji"] . " " . $geo["city"] . ", " . $geo["country_code"];
Global IP Data in One GET Request
One request returns location, network, and threat data for any IPv4 or IPv6 address.
Request only the fields you read. Three fields parse faster than 100, and the difference shows on mobile networks and edge runtimes with tight budgets.
curl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY&fields=ip,city,country_code"curl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY&fields=time_zone.id"{ "ip": "134.201.250.155", "city": "Los Angeles", "country_code": "US" }
Most teams call it server-side, at the point data enters the system: signup writes, log ingestion, and edge request handling.
Attach country_code and city to every new account or inbound event at write time. Downstream jobs read enriched records instead of raw addresses.
Resolve IPs during ingestion so dashboards group by geography without a join. One lookup per unique address, cached, keeps request volume flat.
Call the API from serverless and edge functions, filter the payload down with fields=, and branch the response before origin ever sees the request.
The real-time IP lookup API page goes deeper on continuous fraud and ops checks.
The IPstack MCP server exposes the API to AI tools as structured tools instead of raw HTTP calls. Agents get back the same JSON shape as a direct request.
npx @apilayer/mcp-server{ "mcpServers": { "apilayer": { "command": "npx", "args": ["@apilayer/mcp-server"], "env": { "APILAYER_ACCESS_KEY": "YOUR_KEY" } } } }
Responses come back in milliseconds and hold that pace at production volume. Live availability is public on the API status page.
Send one GET request: curl “https://api.ipstack.com/{ip}?access_key=YOUR_KEY”. JSON is the default output, so no format parameter is needed. The response returns location, timezone, currency, connection, and security fields depending on your plan, with every included group delivered together in a single JSON object.
Five groups: location (country, region, city, ZIP, coordinates, flags), time zone, currency, connection (ISP and ASN), and security (proxy, Tor, threat scoring). A full response adds up to 100+ fields. Each field is documented with its type, an example, and the module it belongs to.
Yes. Append output=xml for XML, or callback=yourFunction for a JSONP-wrapped response that legacy browser code can consume. Both wrap the same data as the JSON default, and both formats work as a single query-string change appended to any existing request URL.
Yes: GET https://api.ipstack.com/check?access_key=YOUR_KEY resolves the caller’s own address and returns the same JSON object as a standard lookup. It is the quickest way to test a new key, and the standard way to look up visitors without extracting their IP yourself.
Field availability follows your plan: the free plan returns the location group, Basic and above add time zone, currency, and connection, and the security group is Professional+. A missing group means your plan does not include it, not that the request failed. The free IP API plan page lists what every plan returns.
Use the fields parameter to request only what you need: fields=ip,city,country_code returns three fields instead of the full object. Nested fields work with dot notation, like fields=time_zone.id. Smaller payloads parse faster, and the difference matters most on mobile networks and edge runtimes with tight budgets.
The JSON IP API sample command works as-is once your key is in it.