📡 API Usage Guide

Available Endpoints

GET / - Plain IP or HTML

Returns your IP address in plain text for CLI tools (curl, wget) or renders a full HTML page for browsers.

curl https://devops-it.ru
wget -qO- https://devops-it.ru
Response: 203.0.113.42

GET /json - JSON Format

Returns detailed information about your connection in JSON format.

curl https://devops-it.ru/json
Response example:
{
  "ip": "203.0.113.42",
  "user_agent": "curl/7.68.0",
  "method": "GET",
  "protocol": "HTTP/1.1",
  "geo_data": {
    "city": "Moscow",
    "country": "Russia",
    "country_code": "RU",
    "latitude": 55.7558,
    "longitude": 37.6173,
    "timezone": "Europe/Moscow",
    "asn": "AS12345",
    "org": "Example ISP"
  }
}

GET /text - Plain Text Format

Returns connection details in human-readable plain text format.

curl https://devops-it.ru/text
Response example:
IP Address: 203.0.113.42
Hostname: example.com
City: Moscow
Country: Russia (RU)
Coordinates: 55.7558, 37.6173
Timezone: Europe/Moscow
ISP: Example ISP
ASN: AS12345

GET /info - HTML Info Page

Displays detailed information in a web browser interface.

https://devops-it.ru/info

GET /stats - Statistics (JSON)

Returns API usage statistics.

curl https://devops-it.ru/stats
Response:
{
  "total_visits": 12543,
  "html_visits": 8234,
  "api_visits": 3102,
  "cli_visits": 1207
}

GET /metrics - Prometheus Metrics

Exposes metrics for Prometheus monitoring.

curl https://devops-it.ru/metrics

Usage Examples

Shell Scripts

# Get your public IP
MY_IP=$(curl -s https://devops-it.ru)
echo "My IP is: $MY_IP"

Python

import requests

# Get JSON data
response = requests.get('https://devops-it.ru/json')
data = response.json()
print(f"IP: {data['ip']}, Country: {data['geo_data']['country']}")

JavaScript (Node.js)

fetch('https://devops-it.ru/json')
.then(res => res.json())
.then(data => console.log('IP:', data.ip));
💡 Note: All endpoints support HTTPS. Rate limiting may apply for excessive requests.

Response Headers