IP geolocation API
abstractapi · Company
Abstract IP geolocation API allows developers to retrieve the region, country and city behind any IP worldwide. The API covers the geolocation of IPv4 and IPv6 addresses in 180+ countries worldwide. Extra information can be retrieved like the currency, flag or language associated to an IP.
Authentication
Sample Requests
Retrieve the location of an IP address
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/abstractapi.com/geolocation/1.0.0/v1/?fields=country%2Ccity%2Ctimezone&api_key=YOUR_API_KEY&ip_address=195.154.25.40"
import requests
params = {
"fields": "country,city,timezone",
"api_key": "YOUR_API_KEY",
"ip_address": "195.154.25.40"
}
response = requests.get(
"https://api.apis.guru/v2/specs/abstractapi.com/geolocation/1.0.0/v1/",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/abstractapi.com/geolocation/1.0.0/v1/');
url.searchParams.set('fields', 'country,city,timezone');
url.searchParams.set('api_key', 'YOUR_API_KEY');
url.searchParams.set('ip_address', '195.154.25.40');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/abstractapi.com/geolocation/1.0.0/v1/")
q := baseURL.Query()
q.Set("fields", "country,city,timezone")
q.Set("api_key", "YOUR_API_KEY")
q.Set("ip_address", "195.154.25.40")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
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("https://api.apis.guru/v2/specs/abstractapi.com/geolocation/1.0.0/v1/")
uri.query = URI.encode_www_form({
"fields" => "country,city,timezone",
"api_key" => "YOUR_API_KEY",
"ip_address" => "195.154.25.40"
})
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 = "https://api.apis.guru/v2/specs/abstractapi.com/geolocation/1.0.0/v1/?" . http_build_query([
"fields" => "country,city,timezone",
"api_key" => "YOUR_API_KEY",
"ip_address" => "195.154.25.40"
]);
$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
- See official documentation for authentication and setup.
What can you build with IP geolocation API?
IP geolocation API is a Company API. Developers commonly use company APIs for:
- enriching CRM records with company firmographics
- building lead-generation and prospecting tools
- verifying business identity and registration details
- monitoring competitors and market intelligence
- powering B2B data enrichment pipelines
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. IP geolocation API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?