The IPCheck API helps developers detect the public IP address their application uses to reach the internet. It is designed for quick diagnostics, automation tooling, and production-safe IP checks.
https://ipcheck.codecraftinglabs.com| Endpoint | Returns | Format | Notes |
|---|---|---|---|
GET/v1/raw |
Client public IP | text/plain |
Versioned raw endpoint. |
GET/v1/json |
IP + country | application/json |
Country may be null. |
GET/v1/ipv4 |
IPv4 only | text/plain |
204 if client is not IPv4. |
GET/v1/ipv6 |
IPv6 only | text/plain |
204 if client is not IPv6. |
GET/v1/country |
Country code only | text/plain |
204 if unknown/unavailable. |
GET/v1/info |
Diagnostics payload | application/json |
Sanitized headers + request details for troubleshooting. |
GET/healthz |
Service health | text/plain |
Useful for monitoring/uptime checks. |
/v1/raw or /v1/json in production. Use /v1/info when debugging proxy/CDN behavior.
/v1/info
curl https://ipcheck.codecraftinglabs.com/v1/info
{
"ip": "203.0.113.10",
"ip_version": 4,
"country": "US",
"method": "GET",
"host": "ipcheck.codecraftinglabs.com",
"path": "/v1/info",
"query": {},
"user_agent": "curl/8.5.0",
"forwarded_for": "198.51.100.2",
"timestamp": "2025-12-22T11:00:00+05:30",
"headers": {
"user-agent": "curl/8.5.0",
"accept": "*/*",
"cf-ipcountry": "US",
"cf-ray": "..."
}
}
/v1/info is meant for safe debugging.
curl https://ipcheck.codecraftinglabs.com/v1/raw
203.0.113.10
/v1/json. For network troubleshooting, use /v1/info.
curl https://ipcheck.codecraftinglabs.com/v1/json
{
"ip": "203.0.113.10",
"country": "US"
}
country may be null if unavailable/unknown.
/v1/raw, /v1/ipv4, /v1/ipv6, /v1/country
text/plain; charset=utf-8
/v1/json, /v1/info
application/json
Retry-After)
To keep the service reliable for everyone, requests are rate-limited. The regular rate limit is 60 requests per minute per IP. If you exceed the limit, you will receive
HTTP 429 and (when available) a Retry-After header.
Retry-After, avoid tight retry loops, and use exponential backoff with jitter for retries.
Too Many Requests Retry-After: 12s
{
"error": "too_many_requests",
"message": "Too Many Requests",
"retry_after": 12
}
We expose country using Cloudflare’s IP geolocation signal (CF-IPCountry) so we can provide
country-only data without making third-party IP intelligence API calls (which often have strict rate limits).
US, LK).
/v1/country returns 204, and JSON responses return "country": null.
using var http = new HttpClient();
var ip = await http.GetStringAsync("https://ipcheck.codecraftinglabs.com/v1/raw");
Console.WriteLine(ip.Trim());
using System.Net.Http.Json;
public sealed class IpCheckDto
{
public string? ip { get; set; }
public string? country { get; set; }
}
using var http = new HttpClient();
var data = await http.GetFromJsonAsync("https://ipcheck.codecraftinglabs.com/v1/json");
Console.WriteLine($"IP: {data?.ip} | Country: {data?.country ?? "N/A"}");
Retry-After header (when present) and back off before retrying.
import requests
r = requests.get("https://ipcheck.codecraftinglabs.com/v1/raw", timeout=10)
r.raise_for_status()
print(r.text.strip())
import requests
r = requests.get("https://ipcheck.codecraftinglabs.com/v1/json", timeout=10)
r.raise_for_status()
data = r.json()
print("IP:", data.get("ip"))
print("Country:", data.get("country") or "N/A")
const res = await fetch("https://ipcheck.codecraftinglabs.com/v1/raw");
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const ip = (await res.text()).trim();
console.log(ip);
const res = await fetch("https://ipcheck.codecraftinglabs.com/v1/json", {
headers: { "Accept": "application/json" }
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log("IP:", data.ip);
console.log("Country:", data.country ?? "N/A");
204 gracefully. IPv4/IPv6/country endpoints can return no content depending on network conditions./v1/info for debugging. It is intentionally verbose and designed to help you diagnose proxies/CDN behavior.Retry-After and add exponential backoff.You’re welcome to integrate IPCheck into automation tools, diagnostics, internal dashboards, and developer utilities. If you need higher-volume usage or custom behavior (e.g., dedicated quotas), contact us with: