IPLocate - Instant IP Address & Geolocation Lookup API

Want to get started right away?
Don't wait, run one of the code samples below in your terminal and check it out!

Basic IP Data (v4/v6)

$ curl 'https://iplocate.net/api/ip'
{
    "ip":"216.73.217.148",
    "ip_ver": "v4"
}
                                
                                

Detailed IP Data (v4/v6)

$ curl 'https://iplocate.net/api/ip?params=all'
{
    "ip": "216.73.217.148",
    "ip_ver": "v4",
    "city": "Columbus",
    "continent": "North America",
    "country": "United States",
    "country_iso": "US",
    "latitude": 39.9625,
    "longitude": -83.0061,
    "timezone": "America/New_York",
    "postal": "43215",
    "asn": "Amazon.com, Inc.",
    "asn_number": 16509
}
                                
                                

Visualized IP Information

IPv4 216.73.217.148
CONTINENT North America
COUNTRY United States
country US COUNTRY ISO US
CITY Columbus
POSTCODE 43215
LATITUDE 39.9625
LONGITUDE -83.0061
Timezone America/New_York
ASN Amazon.com, Inc.
Mobile
Proxy
Hosting

Why IPLocate?

Need your public IP on the fly?

Whether you're setting up cloud infrastructure, debugging network issues, or working behind a firewall - iplocate gives you instant access to your IP, location, and provider info.

KEY FEATURES

Free to use

Completely free for everyone. No credit card, no subscription, no hidden fees.

IPv4 & IPv6

Full support for both IPv4 and IPv6. No matter how you connect — it just works.

Always online

Built to stay up. Reliable infrastructure, minimal downtime — always ready when you need it.

Precise geolocation

Get precise location data — country, region, and city — in one request.

Privacy first

No visitor data is logged or stored. Ever. Your requests stay yours.

Developer friendly

Clean JSON API, simple integration. Drop it into any project in minutes.


Like IPLocate? Share it with others!


API Usage

Using IPLocate is quite simple. Make a request to our API endpoint with optional parameters to get your IP geolocation data in JSON format. Need to lookup specific IP addresses or process multiple IPs at once? Check out our API documentation for detailed information and bulk processing capabilities.

Request Parameters

Parameter Type Description Example
ip string IP address to lookup (optional, returns your current IP if not provided) 8.8.8.8
fields string Comma-separated list of fields to return. Use 'all' for all fields (optional, returns ip and ip_ver only if not provided) city,country,latitude
output string Response format: 'json' (default) or 'plain' (returns only IP address as plain text) json

Available Fields

Field Description
ipAlways included - IP address
ip_verAlways included - IP version (v4 or v6)
cityCity name
countryCountry name
country_isoCountry ISO code (2-letter)
continentContinent name
latitudeLatitude coordinate
longitudeLongitude coordinate
timezoneTimezone identifier (e.g., Europe/London)
postalPostal/ZIP code
asnISP/Organization name
asn_numberAutonomous System Number

Code Samples

This section contains common usage patterns from a variety of programming languages.

#!/bin/bash

# Get your current IP (basic info)
curl 'https://iplocate.net/api/ip'

# Get your IP as plain text only
curl 'https://iplocate.net/api/ip?output=plain'

# Get all available fields for your IP
curl 'https://iplocate.net/api/ip?fields=all'

# Get specific fields only
curl 'https://iplocate.net/api/ip?fields=city,country,timezone'

# Lookup specific IP with all fields
curl 'https://iplocate.net/api/ip?ip=8.8.8.8&fields=all'

# Lookup specific IP with selected fields
curl 'https://iplocate.net/api/ip?ip=1.1.1.1&fields=country,city,asn'
# This example requires the requests library
# Install: pip install requests

import requests

# Get basic info for your IP
response = requests.get('https://iplocate.net/api/ip')
data = response.json()
print(f"Your IP: {data['data']['ip']}")

# Get all fields for your IP
response = requests.get(
    'https://iplocate.net/api/ip',
    params={'fields': 'all'}
)
data = response.json()
print(f"Location: {data['data']['city']}, {data['data']['country']}")

# Get specific fields only
response = requests.get(
    'https://iplocate.net/api/ip',
    params={'fields': 'city,country,latitude,longitude'}
)

# Lookup specific IP
response = requests.get(
    'https://iplocate.net/api/ip',
    params={
        'ip': '8.8.8.8',
        'fields': 'all'
    }
)

# Get IP as plain text
response = requests.get(
    'https://iplocate.net/api/ip',
    params={'output': 'plain'}
)
print(response.text)  # Just the IP address
// Get basic info for your IP
fetch('https://iplocate.net/api/ip')
.then(response => response.json())
.then(result => {
const data = result.data;
console.log(`Your IP: ${data.ip}`);
});

// Get all fields for your IP
fetch('https://iplocate.net/api/ip?fields=all')
.then(response => response.json())
.then(result => {
const data = result.data;
console.log(`Location: ${data.city}, ${data.country}`);
});

// Get specific fields only
fetch('https://iplocate.net/api/ip?fields=city,country,timezone')
.then(response => response.json())
.then(result => console.log(result.data));

// Lookup specific IP
fetch('https://iplocate.net/api/ip?ip=8.8.8.8&fields=all')
.then(response => response.json())
.then(result => console.log(result.data));

// Get IP as plain text
fetch('https://iplocate.net/api/ip?output=plain')
.then(response => response.text())
.then(ip => console.log(`My IP: ${ip}`));
<?php
// Get basic info for your IP
$response = json_decode(file_get_contents('https://iplocate.net/api/ip'), true);
$data = $response['data'];
echo "Your IP: " . $data['ip'] . "\n";

// Get all fields for your IP
$url = 'https://iplocate.net/api/ip?fields=all';
$response = json_decode(file_get_contents($url), true);
$data = $response['data'];
echo "Location: " . $data['city'] . ", " . $data['country'] . "\n";

// Get specific fields only
$url = 'https://iplocate.net/api/ip?fields=city,country,timezone';
$response = json_decode(file_get_contents($url), true);

// Lookup specific IP
$url = 'https://iplocate.net/api/ip?ip=8.8.8.8&fields=all';
$response = json_decode(file_get_contents($url), true);

// Get IP as plain text
$ip = file_get_contents('https://iplocate.net/api/ip?output=plain');
echo "My IP: " . $ip;

?>
require 'net/http'
require 'json'
# Get basic info for your IP
uri = URI('https://iplocate.net/api/ip')
response = Net::HTTP.get(uri)
result = JSON.parse(response)
data = result['data']
puts "Your IP: #{data['ip']}"
# Get all fields for your IP
uri = URI('https://iplocate.net/api/ip?fields=all')
response = Net::HTTP.get(uri)
result = JSON.parse(response)
data = result['data']
puts "Location: #{data['city']}, #{data['country']}"
# Get specific fields only
uri = URI('https://iplocate.net/api/ip?fields=city,country,timezone')
response = Net::HTTP.get(uri)
# Lookup specific IP
uri = URI('https://iplocate.net/api/ip?ip=8.8.8.8&fields=all')
response = Net::HTTP.get(uri)

# Get IP as plain text
uri = URI('https://iplocate.net/api/ip?output=plain')
ip = Net::HTTP.get(uri)
puts "My IP: #{ip}"
package main

import (
"encoding/json"
"fmt"
"io"
"net/http"
)

type Response struct {
Success bool                   `json:"success"`
Data    map[string]interface{} `json:"data"`
}
func main() {
// Get basic info for your IP
resp, err := http.Get("https://iplocate.net/api/ip")
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Printf("Your IP: %s\n", result.Data["ip"])
// Get all fields for your IP
resp, _ = http.Get("https://iplocate.net/api/ip?fields=all")
defer resp.Body.Close()
body, _ = io.ReadAll(resp.Body)
json.Unmarshal(body, &result)

fmt.Printf("Location: %s, %s\n", result.Data["city"], result.Data["country"])

// Get IP as plain text
resp, _ = http.Get("https://iplocate.net/api/ip?output=plain")
defer resp.Body.Close()
ip, _ := io.ReadAll(resp.Body)
fmt.Printf("My IP: %s\n", ip)
}

Official Libraries

Want to integrate IPLocate into your application with minimal effort? We're building official client libraries to make your life easier. More languages coming soon!

Library Language Author Status Setup
iplocate-python PythonPython Efimenco Vladimir Official pip install iplocate-client==0.1.0

Note: Don't see a library for your language? I'd love to feature it here! Contact me if you've built a client library.

Cookie Notice

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.