API Documentation

Easy to integrate REST API

Quick Start

Get your IP address from the terminal:

curl who-is.hu/ip

Response: 216.73.216.53

Endpoints

GET /ip

Returns the client's IP address as plain text.

curl who-is.hu/ip

Response (text/plain):

216.73.216.53

GET /json

Returns the client's IP address with related information in JSON format.

curl who-is.hu/json

Response (application/json):

{
  "ip": "216.73.216.53",
  "version": "IPv4",
  "asn": "AS16509",
  "country": "US",
  "tor_exit": false
}

GET /api/myip

Returns the client's IP address in JSON format (minimal).

curl who-is.hu/api/myip

Response:

{
  "ip": "216.73.216.53",
  "version": "IPv4"
}

GET /api/lookup/{query}

IP address or domain lookup.

curl who-is.hu/api/lookup/8.8.8.8

Response for IP address:

{
  "query": "8.8.8.8",
  "type": "ipv4",
  "ip": {
    "ip": "8.8.8.8",
    "version": "ipv4",
    "hostname": [
      "dns.google"
    ],
    "asn": "AS15169",
    "organization": "Google LLC",
    "country": "US",
    "network": "GOGL",
    "handle": "NET-8-8-8-0-2",
    "cidr": "8.8.8.0/24",
    "tor_exit": false,
    "note": "Data provided by regional internet registries."
  }
}
curl who-is.hu/api/lookup/who-is.hu

Response for domain name:

{
  "query": "who-is.hu",
  "type": "domain",
  "ip": {
    "ip": "188.114.97.2",
    "version": "ipv4",
    "asn": "AS13335",
    "organization": "Cloudflare Abuse Contact",
    "country": "US",
    "network": "CLOUDFLARENET-EU",
    "handle": "188.114.96.0 - 188.114.99.255",
    "cidr": "188.114.96.0/22",
    "tor_exit": false,
    "note": "Data provided by regional internet registries."
  },
  "dns": {
    "domain": "who-is.hu",
    "a": [
      "188.114.97.2",
      "188.114.96.2"
    ],
    "aaaa": [
      "2a06:98c1:3121::2",
      "2a06:98c1:3120::2"
    ],
    "ns": [
      "hunts.ns.cloudflare.com",
      "vita.ns.cloudflare.com"
    ],
    "soa": "hunts.ns.cloudflare.com. dns.cloudflare.com. 2396144553 10000 2400 604800 1800",
    "resolved_ips": {
      "hunts.ns.cloudflare.com": "108.162.195.46",
      "vita.ns.cloudflare.com": "108.162.192.238"
    }
  }
}

GET /api/health

Service health check.

curl who-is.hu/api/health

Response:

{
  "status": "ok"
}

Usage Examples

Bash

#!/bin/bash
MY_IP=$(curl -s who-is.hu/ip)
echo "IP: $MY_IP"

Python

import requests

ip = requests.get('https://who-is.hu/ip').text
print(f'IP: {ip}')

data = requests.get('https://who-is.hu/json').json()
print(f'Organization: {data.get("organization")}')

JavaScript (fetch)

fetch('https://who-is.hu/ip')
  .then(r => r.text())
  .then(ip => console.log('IP:', ip));

fetch('https://who-is.hu/json')
  .then(r => r.json())
  .then(data => console.log(data));

Rate Limiting

The service limits the number of requests to prevent abuse:

If exceeded, you will receive a 429 Too Many Requests response.

Errors

In case of an error, a JSON error message is returned:

{
  "error": "invalid query"
}
400 Invalid request (bad IP/domain format)
429 Too many requests (rate limit)
500 Server error