IP-API
ip-api.com · Developer Tools
IP geolocation API — get country, region, city, ISP, timezone, and coordinates from any IP address. Free for non-commercial use, no API key required. 45 requests/minute limit.
Authentication
Sample Requests
Get geolocation for Google's DNS server.
Hover any highlighted part to learn what it does
curl -X GET "http://ip-api.com/json/8.8.8.8"
import requests
response = requests.get(
"http://ip-api.com/json/8.8.8.8",
)
print(response.json())const url = 'http://ip-api.com/json/8.8.8.8'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "http://ip-api.com/json/8.8.8.8"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("http://ip-api.com/json/8.8.8.8")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "http://ip-api.com/json/8.8.8.8";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get geolocation for the requesting IP (your own).
Hover any highlighted part to learn what it does
curl -X GET "http://ip-api.com/json"
import requests
response = requests.get(
"http://ip-api.com/json",
)
print(response.json())const url = 'http://ip-api.com/json'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "http://ip-api.com/json"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("http://ip-api.com/json")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "http://ip-api.com/json";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed (HTTP only — HTTPS requires paid plan)
- Try GET http://ip-api.com/json/1.1.1.1
- Omit IP to geolocate yourself: GET http://ip-api.com/json
- Add ?fields=city,country,lat,lon to select specific fields
What can you build with IP-API?
IP-API is a Developer Tools API. Developers commonly use developer tools APIs for:
- automating code review and quality checks
- integrating CI/CD pipelines and build systems
- managing feature flags and A/B tests
- monitoring errors and application performance
- generating and validating test data
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. IP-API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide