JSON IP API: Any IP's Data in One GET Request

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"
200 OK · application/jsonSAMPLE
{
  "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.

The Full JSON Response, Explained

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.

GET https://api.ipstack.com/134.201.250.155?access_key=YOUR_KEY · complete objectSAMPLE
{
  "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 }
}
FieldTypeExampleDescriptionModule
Location
ipstring"134.201.250.155"The address that was resolvedCORE
typestring"ipv4"ipv4 or ipv6CORE
country_code / country_namestring"US" · "United States"ISO 3166-1 countryCORE
region_code / region_namestring"CA" · "California"State, province, or regionCORE
city / zipstring"Los Angeles" · "90013"Resolved city and postal codeCORE
latitude / longitudenumber34.0453 · -118.2413Coordinates of the area centroidCORE
location.capitalstring"Washington D.C."Capital of the resolved countryCORE
location.languagesarray[{"code":"en"}]Official languages with ISO codesCORE
location.country_flag_emojistring"🇺🇸"Flag ready for UI displayCORE
location.calling_codestring"1"International dialing prefixCORE
location.is_eubooleanfalseEU membership flag for consent logicCORE
Time zone
time_zone.idstring"America/Los_Angeles"IANA timezone identifierPAID PLANS
time_zone.current_timestring"2026-08-19T06:22:04-07:00"Local time at the address nowPAID PLANS
time_zone.gmt_offsetnumber-25200Offset from GMT in secondsPAID PLANS
Currency
currency.code / symbolstring"USD" · "$"ISO 4217 currency for price displayPAID PLANS
currency.name / pluralstring"US Dollar" · "US dollars"Currency names for checkout copyPAID PLANS
Connection
connection.asnnumber174Autonomous system numberPAID PLANS
connection.ispstring"Cogent Communications"Operator serving the addressPAID PLANS
connection.connection_typestring"corporate"Line type behind the addressPAID PLANS
Security
security.is_proxy / proxy_typeboolean / stringfalse · nullProxy detection and classificationPROFESSIONAL+
security.is_tor / is_crawlerbooleanfalse · falseTor exit and bot identificationPROFESSIONAL+
security.threat_level / threat_typesstring / array"low" · nullAggregated risk scoringPROFESSIONAL+

Module availability follows your plan; details are on the pricing page.

Get Your Visitor's IP in JSON (One Endpoint)

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.

Output Options: JSON by Default, XML and JSONP When You Need Them

JSON needs no format parameter. Add output=xml or callback= when a system expects something else.

JSONcurl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY"
XMLcurl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY&output=xml"
JSONPcurl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY&callback=myHandler"
FormatParameterWhen to use it
JSONnone (default)Everything modern: apps, services, pipelines, agents
XMLoutput=xmlLegacy systems and XML-native tooling
JSONPcallback=myHandlerOld browser code that cannot use CORS

Parse It: JavaScript, Python, PHP

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.

Trim the Payload: Field Filtering for Faster Responses

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.

Fieldscurl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY&fields=ip,city,country_code"
Nestedcurl "https://api.ipstack.com/{ip}?access_key=YOUR_KEY&fields=time_zone.id"
fields=ip,city,country_code
{ "ip": "134.201.250.155", "city": "Los Angeles", "country_code": "US" }

Where Teams Plug In a JSON IP API

Most teams call it server-side, at the point data enters the system: signup writes, log ingestion, and edge request handling.

Enrich signups and webhooks

Attach country_code and city to every new account or inbound event at write time. Downstream jobs read enriched records instead of raw addresses.

Feed log and analytics pipelines

Resolve IPs during ingestion so dashboards group by geography without a join. One lookup per unique address, cached, keeps request volume flat.

Personalize at the edge

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 Same JSON, Served Over MCP

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.

Runnpx @apilayer/mcp-server
  • Works with Claude Desktop, Cursor, VS Code Copilot, Windsurf, and Cline
  • Covers every endpoint: standard lookup, requester checks, and bulk requests
  • Authenticates with the same access key you use for HTTP calls
MCP client config · Claude Desktop, Cursor, and others
{
  "mcpServers": {
    "apilayer": {
      "command": "npx",
      "args": ["@apilayer/mcp-server"],
      "env": {
        "APILAYER_ACCESS_KEY": "YOUR_KEY"
      }
    }
  }
}

Fast, Stable, and Built for Production

Responses come back in milliseconds and hold that pace at production volume. Live availability is public on the API status page.

99.9%
Uptime
IPv4 + IPv6
One response shape
HTTPS
On all paid plans
104
Predictable quota error, never a surprise bill

Frequently Asked Questions - JSON IP API

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.

Copy the cURL. Add Your Key. Ship.

The JSON IP API sample command works as-is once your key is in it.