IPstack API

Geocoding / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

IPstack is a real-time IP geolocation API that lets you look up the geographic location of any IP address, including country, city, latitude, and longitude. You get a free tier with 100 requests per month to get started without a credit card. It is commonly used to personalize content, detect fraud, or restrict access by region.

💡

Beginner Tip

Sign up for a free API key at ipstack.com, then append ?access_key=YOUR_API_KEY to every request URL. The free plan supports HTTP only — upgrade to a paid plan if you need HTTPS.

Available Data

IP address information
geographic location
ASN and ISP data

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from IPstack",
    "description": "Locate and identify website visitors by IP address",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

ip The IP address that was looked up.
country_name Full name of the country associated with the IP address.
city City name associated with the IP address, if available.
latitude Latitude coordinate of the IP location.
longitude Longitude coordinate of the IP location.
currency Currency information for the country, including code and symbol.

Implementation Example

const url = "https://ipstack.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

101 - Invalid API key The access_key parameter is missing, misspelled, or the key has not been activated yet.
Double-check your API key in the ipstack dashboard and ensure it is passed as ?access_key=YOUR_KEY.
105 - HTTPS access restricted Your plan does not include HTTPS access, but you are requesting over https://.
Use http:// instead of https:// for the API endpoint, or upgrade to a paid plan that includes HTTPS.
Empty fields (null values) IPstack does not have geolocation data for the queried IP, such as private or reserved IPs.
Check that you are not querying a local/private IP (e.g., 192.168.x.x or 127.0.0.1). Use a public IP address.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Geocoding
Difficulty Intermediate
Verified: 2026-04-04

Alternatives to IPstack

Technical alternatives for different use cases.

Free tier available with basic geolocation data

Better For

Basic country/city detection on a budget

Trade-off

Detailed ISP and connection type data

Generous free tier with 1K lookups/day, no API key needed

Better For

Small projects that want no-signup IP lookup

Trade-off

Enterprise-scale IP intelligence with SLA

Similar IP geolocation with real-time currency and timezone data

Better For

Projects needing currency info alongside geolocation

Trade-off

Batch IP lookups at scale

Similar APIs

View All →