API

API for the terminal and your programs

Free and no sign-up. Replies in plain text or JSON and can be called from any website (CORS).

Endpoints

Examples

curl (Linux, macOS, Windows)

$ curl ip.com.py
203.0.113.7

PowerShell

PS> (Invoke-RestMethod https://ip.com.py/json).ip
203.0.113.7

Python

import urllib.request, json
data = json.load(urllib.request.urlopen("https://ip.com.py/json"))
print(data["ip"], data["country_code"])

JavaScript

const r = await fetch("https://ip.com.py/json");
const { ip, city } = await r.json();

JSON

$ curl ip.com.py/json
{
    "ip": "203.0.113.7",
    "version": 4,
    "hostname": "host-7.example.net",
    "city": "Asunción",
    "region": "Asunción",
    "country": "Paraguay",
    "country_code": "PY",
    "continent": "Sudamérica",
    "latitude": -25.28,
    "longitude": -57.63,
    "accuracy_radius_km": 20,
    "time_zone": "America/Asuncion",
    "asn": 64500,
    "org": "Ejemplo S.A."
}

JSON fields

Usage limits

To keep the service free, each IP has a limit. If you exceed it, the response is 429 with a Retry-After header (seconds to wait). The X-RateLimit-Limit and X-RateLimit-Remaining headers tell you how many requests you have left.

Location data is approximate and comes from MaxMind GeoLite2.