API Documentation
FckMyIP provides a free, public REST API to retrieve IP geolocation data. No authentication required. Responses are returned in JSON format.
Base URL
https://fckmyip.com
All endpoints return JSON with Content-Type: application/json. HTTPS is required.
Auto-detect your IP
Returns geolocation data for the caller's IP address. The IP is detected automatically from the request.
/api/ip
Request
No parameters required. The API detects your public IP automatically.
curl https://fckmyip.com/api/ip
Response
{
"ip": "203.0.113.42",
"version": "IPv4",
"city": "Paris",
"region": "Γle-de-France",
"country": "France",
"countryCode": "FR",
"continentCode": "EU",
"latitude": 48.8566,
"longitude": 2.3522,
"timeZone": "Europe/Paris",
"isp": "Orange S.A.",
"asn": 3215,
"isEu": true
}
Lookup a specific IP
Returns geolocation data for any given IPv4 or IPv6 address.
/api/ip/{address}
Parameters
address
string
IPv4 or IPv6 address to look up
Request
IPv4
curl https://fckmyip.com/api/ip/8.8.8.8
IPv6
curl https://fckmyip.com/api/ip/2001:4860:4860::8888
Response
{
"ip": "8.8.8.8",
"version": "IPv4",
"city": "Mountain View",
"region": "California",
"country": "United States",
"countryCode": "US",
"continentCode": "NA",
"latitude": 37.386,
"longitude": -122.0838,
"timeZone": "America/Los_Angeles",
"isp": "Google LLC",
"asn": 15169,
"isEu": false
}
Response fields
ipstringThe queried IP addressversionstring"IPv4" or "IPv6"citystring?City name (may be null)regionstring?Region or state (may be null)countrystring?Country name (may be null)countryCodestring?ISO 3166-1 alpha-2 country codecontinentCodestring?Two-letter continent code (EU, NA, AS...)latitudenumber?Approximate latitudelongitudenumber?Approximate longitudetimeZonestring?IANA time zone identifierispstring?Internet Service Provider nameasnnumber?Autonomous System NumberisEubooleanWhether the country is in the European UnionError responses
Errors are returned as JSON with an "error" field describing the issue.
{"error": "Unable to detect IP address"}
{"error": "IP not found or invalid"}
Code examples
JavaScript (fetch)
const response = await fetch("https://fckmyip.com/api/ip");
const data = await response.json();
console.log(`${data.ip} β ${data.city}, ${data.country}`);
Python (requests)
import requests
data = requests.get("https://fckmyip.com/api/ip").json()
print(f"{data['ip']} β {data['city']}, {data['country']}")
C# (HttpClient)
using var http = new HttpClient();
var json = await http.GetStringAsync("https://fckmyip.com/api/ip/8.8.8.8");
Console.WriteLine(json);
PowerShell
Invoke-RestMethod https://fckmyip.com/api/ip | Format-List
Rate limits & fair use
This API is free and requires no API key. We ask that you use it responsibly: avoid mass automated queries and excessive polling. Abusive usage may result in your IP being rate-limited or blocked without notice. If you need high-volume access, please contact us at contact@cognitys.com.