LIVE API

IP Information API

Get detailed information about your IP address including geolocation, network details, and device information.

GET https://ip.freeapi.me/

{
  "ip": {
    "address": "203.0.113.195",
    "version": "IPv4"
  },
  "location": {
    "country": "US",
    "region": "California",
    "city": "San Francisco",
    "timezone": "America/Los_Angeles"
  },
  "network": {
    "asn": "13335",
    "asOrganization": "Cloudflare, Inc."
  }
  ...
}

Documentation

Base URL

https://ip.freeapi.me/

All API requests should be made to this endpoint. HTTPS is required for all API calls.

Request Methods

The IP Information API accepts GET requests only.

Parameters

The following query parameters can be used to customize the API response:

Parameter Type Description
formatoptional string Use format=ip to return just the IP address as plain text. If omitted, returns full JSON response.

Example Requests

# Get full IP information
curl https://ip.freeapi.me/

# Get just the IP address
curl https://ip.freeapi.me/?format=ip
// Get full IP information
fetch('https://ip.freeapi.me/')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
import requests

# Get full IP information
response = requests.get('https://ip.freeapi.me/')
data = response.json()
print(data)
// Get full IP information
$response = file_get_contents('https://ip.freeapi.me/');
$data = json_decode($response, true);
print_r($data);

Response Format

By default, the API returns a JSON object with detailed information about the client's IP address.

{
  "ip": {
    "address": "203.0.113.195",
    "version": "IPv4"
  },
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/91.0.4472.124",
  "language": "en-US,en;q=0.9",
  "location": {
    "country": "US",
    "region": "California",
    "city": "San Francisco",
    "timezone": "America/Los_Angeles"
  },
  "network": {
    "asn": "13335",
    "asOrganization": "Cloudflare, Inc."
  },
  "device": {
    "deviceType": "desktop",
    "mobile": false
  },
  "timestamp": "2023-11-16T15:23:01.789Z"
}

Key Response Properties

  • ip - Contains IP address and version (IPv4/IPv6)
  • location - Geographic data based on the IP address
  • network - Information about the network and connection
  • device - Basic details about the client device
  • timestamp - When the request was processed

Error Responses

The API may return the following error responses:

  • 403 Forbidden - Returned if the request is made over HTTP instead of HTTPS
  • 500 Internal Server Error - Returned if the service encounters an unexpected error