- Sub-100ms responses via Vercel's edge network
- No logging, no tracking, no data storage
- Accurate geolocation data for IPs worldwide
- No API keys required
- Open source and free to use
- Minimal response payload
curl https://ip.hmddevs.org{
"ip": "8.8.8.8",
"country": "US"
}GET https://ip.hmddevs.org/
| Field | Type | Description |
|---|---|---|
ip |
string |
The client's public IP address |
country |
string |
ISO 3166-1 alpha-2 country code (e.g. US, DE, JP) |
| Code | Description |
|---|---|
200 |
Successful response |
fetch('https://ip.hmddevs.org')
.then(response => response.json())
.then(data => {
console.log(`IP: ${data.ip}`);
console.log(`Country: ${data.country}`);
});const getLocation = async () => {
const response = await fetch('https://ip.hmddevs.org');
const { ip, country } = await response.json();
return { ip, country };
};import requests
response = requests.get('https://ip.hmddevs.org')
data = response.json()
print(f"IP: {data['ip']}, Country: {data['country']}")curl -s https://ip.hmddevs.org | jq<?php
$response = file_get_contents('https://ip.hmddevs.org');
$data = json_decode($response, true);
echo "IP: " . $data['ip'] . ", Country: " . $data['country'];
?>package main
import (
"encoding/json"
"fmt"
"net/http"
)
type IPResponse struct {
IP string `json:"ip"`
Country string `json:"country"`
}
func main() {
resp, _ := http.Get("https://ip.hmddevs.org")
defer resp.Body.Close()
var data IPResponse
json.NewDecoder(resp.Body).Decode(&data)
fmt.Printf("IP: %s, Country: %s\n", data.IP, data.Country)
}require 'net/http'
require 'json'
uri = URI('https://ip.hmddevs.org')
response = Net::HTTP.get(uri)
data = JSON.parse(response)
puts "IP: #{data['ip']}, Country: #{data['country']}"use reqwest;
use serde::Deserialize;
#[derive(Deserialize)]
struct IpResponse {
ip: String,
country: String,
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let resp: IpResponse = reqwest::get("https://ip.hmddevs.org")
.await?
.json()
.await?;
println!("IP: {}, Country: {}", resp.ip, resp.country);
Ok(())
}- Node.js 18+
- Vercel CLI (optional)
git clone https://github.com/hmddevs/ip-api.git
cd ip-api
npm installnpm run devVisit http://localhost:3000 to test locally.
Or via CLI:
npm install -g vercel
vercel --prodip-api/
├── api/
│ └── index.js # Main API handler
├── test/
│ └── api.test.js # Unit tests
├── .github/
│ ├── ISSUE_TEMPLATE/ # Issue templates
│ ├── workflows/ # CI/CD
│ └── dependabot.yml # Dependency updates
├── openapi.yaml # OpenAPI 3.1 specification
├── package.json
├── vercel.json
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── SECURITY.md
└── LICENSE
npm run dev # Start development server
npm run lint # Run linting
npm run lint:fix # Fix linting issues
npm test # Run tests
npm run deploy # Deploy to productionSee CONTRIBUTING.md for guidelines.
Found a vulnerability? See SECURITY.md.
- MaxMind GeoLite2 for geolocation data
- geoip-lite for the Node.js geolocation library
- Vercel for hosting
Copyright 2025 HMD Developments, Inc.