One GET request. JSON response. Works in any language.
cURL
JavaScript
Python
Go
# Lookup any IP
curl https://api.ip-atlas.io/json/8.8.8.8 \
-H "X-API-Key: your_api_key"
# Self-lookup (caller's IP)
curl https://api.ip-atlas.io/json \
-H "X-API-Key: your_api_key"
const response = await fetch('https://api.ip-atlas.io/json/8.8.8.8', {
headers: { 'X-API-Key': 'your_api_key' }
});
const data = await response.json();
// {
// "ip": "8.8.8.8",
// "country": "US",
// "country_name": "United States",
// "asn": 15169,
// "org": "Google LLC",
// "is_datacenter": true,
// "is_vpn": false
// }
import requests
response = requests.get(
'https://api.ip-atlas.io/json/8.8.8.8',
headers={'X-API-Key': 'your_api_key'}
)
data = response.json()
print(data['country']) # US
print(data['org']) # Google LLC
print(data['is_vpn']) # False
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func lookupIP(ip, apiKey string) (map[string]interface{}, error) {
req, _ := http.NewRequest("GET", "https://api.ip-atlas.io/json/"+ip, nil)
req.Header.Set("X-API-Key", apiKey)
resp, err := http.DefaultClient.Do(req)
if err != nil { return nil, err }
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
return result, nil
}