How to Use the
IPstack API

Learn how to integrate IPstack API into your geolocation or geofencing applications with our comprehensive and quick guide.

Get Started in Three Simple Steps

From signup to your first API call in under 2 minutes.
1
Create your free IPstack account and receive your unique access key instantly.
2
Use our Postman collection, or make requests directly in your browser, or use your preferred API client to get IP geolocation data in JSON format.
3

Detect suspicious activities and prevent fraud with location intelligence.

Code Snippets and Integrations

Ready-to-use code snippets in your favorite programming languages.

				
					
const url = "https://api.ipstack.com/134.201.250.155?access_key={PASTE_YOUR_API_KEY_HERE}&callback=MY_FUNCTION";
const options = {
    method: "GET",
};

try {
    const response = await fetch(url, options);
    const result = await response.text();
    console.log(result);
} catch (error) {
    console.error(error);
}
				
			
				
					
import axios from "axios";

const options = {
    method: "GET",
    url: "https://api.ipstack.com/134.201.250.155?access_key={PASTE_YOUR_API_KEY_HERE}&callback=MY_FUNCTION",
};

try {
    const response = await axios.request(options);
    console.log(response.data);
} catch (error) {
    console.error(error);
}
				
			
				
					
import requests

url = "https://api.ipstack.com/134.201.250.155?access_key={PASTE_YOUR_API_KEY_HERE}&callback=MY_FUNCTION"

response = requests.get(url)

print(response.json())
				
			
				
					
import http.client

conn = http.client.HTTPSConnection("api.ipstack.com")

conn.request("GET", "/134.201.250.155?access_key={PASTE_YOUR_API_KEY_HERE}&callback=MY_FUNCTION")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
				
			

What You Can Do with IPstack API

IPstack API provides everything you need to build location-aware applications with ease and precision.
  • Get location data (country, region, city, coordinates)
  • Access ISP and connection information
  • Detect security threats and proxy usage
  • Retrieve timezone and currency data
  • Bulk IP lookups for processing multiple IPs
  • HTTPS encryption for secure requests
IPstack Endpoints

GET api.ipstack.com/{ip}

Standard IP lookup

GET api.ipstack.com/check

Lookup visitor’s IP

GET api.ipstack.com/{ip1,ip2,...}

Bulk IP lookup