GET /api/ip
ip (optional), format=json|text
Public IP and approximate location; check geoStatus and nullable fields.
Public REST API · JSON and plain text
Request a public IP, approximate location, ISP and ASN without an API key. Integrate DNS, RDAP and network diagnostics with explicit limits and error handling.
These direct REST examples run independently of the npm and PyPI SDKs. They set timeouts, reject HTTP errors and keep incomplete location results distinct. Copying does not send an API request.
# One request. Plain text skips the geolocation provider.
# Keep the value in memory; do not put it in analytics or logs.
if public_ip=$(curl --fail --silent --show-error \
--connect-timeout 5 --max-time 10 \
'https://ipbulucu.org/api/ip?format=text'); then
printf 'Public IP received.\n'
else
printf 'Lookup failed; no automatic retry.\n' >&2
fi// Node.js 18+; save as lookup.cjs and run: node lookup.cjs
// No package install required. One request, no automatic retry.
async function getIp(targetIp = "") {
const url = new URL("https://ipbulucu.org/api/ip");
url.searchParams.set("format", "json");
if (targetIp) url.searchParams.set("ip", targetIp);
let response;
try {
response = await fetch(url, { signal: AbortSignal.timeout(10000) });
} catch {
throw new Error("Network request failed or timed out");
}
if (response.status === 429) {
throw new Error("HTTP 429: wait for Retry-After before another request");
}
if (!response.ok) throw new Error("HTTP " + response.status);
let data;
try { data = await response.json(); }
catch { throw new Error("Invalid or incomplete JSON response"); }
if (!data || typeof data !== "object" || Array.isArray(data) ||
data.success !== true || typeof data.ip !== "string") {
throw new Error("API did not return a successful IP lookup");
}
return data;
}
async function main() {
try {
// With no argument this is the server's egress IP, not an end user's IP.
const data = await getIp();
// Keep raw fields in your application; log only a fixed status label.
console.log(data.geoStatus === "available" && data.partial !== true
? "IP and approximate location available"
: "IP available; location incomplete or unavailable");
} catch {
// Do not log the URL, input, raw response or error from your own wrapper.
console.error("Lookup failed; no automatic retry");
process.exitCode = 1;
}
}
main();# Python 3; install dependency: python -m pip install requests
# Save as lookup.py and run: python lookup.py
import requests
def get_ip(target_ip=None):
params = {"format": "json"}
if target_ip:
params["ip"] = target_ip
try:
response = requests.get(
"https://ipbulucu.org/api/ip", params=params, timeout=(5, 10)
)
except requests.RequestException:
raise RuntimeError("Network request failed or timed out") from None
if response.status_code == 429:
raise RuntimeError("HTTP 429: wait for Retry-After before another request")
if not 200 <= response.status_code < 300:
raise RuntimeError("HTTP " + str(response.status_code))
try:
data = response.json()
except ValueError:
raise RuntimeError("Invalid JSON response") from None
if not isinstance(data, dict) or data.get("success") is not True or not isinstance(data.get("ip"), str):
raise RuntimeError("API did not return a successful IP lookup")
return data
def main():
try:
# No argument: the server's egress IP, not an end user's IP.
data = get_ip()
# Fixed labels only; no lookup input or response values in logs.
if data.get("geoStatus") == "available" and data.get("partial") is not True:
print("IP and approximate location available")
else:
print("IP available; location incomplete or unavailable")
except RuntimeError:
print("Lookup failed; no automatic retry")
raise SystemExit(1)
if __name__ == "__main__":
main()| Signal | What it means |
|---|---|
| success: true | The operation returned a result; not proof that every field was measured. |
| geoStatus: unavailable | IP discovery can succeed while location data is unavailable. Keep null values unknown. |
| partial: true | Some checks could not complete. Read per-source results and limitations; do not report a full pass. |
| HTTP 400 / 405 | Fix the input or method. Retrying the same request will not help. |
| HTTP 429 | Stop and respect Retry-After. These examples do not automatically retry. |
| HTTP 5xx / timeout | The result is unavailable. If your application retries, use a small attempt limit and backoff; never a tight polling loop. |
Geolocation is approximate. This IP endpoint does not measure VPN, Tor, proxy, identity, CGNAT, line speed or reputation. Running it from a server or an AI tool without an ip argument returns that server’s egress IP, not the human user’s IP.
Base URL: https://ipbulucu.org/api. All endpoints below use GET. See OpenAPI for parameter types and response schemas.
ip (optional), format=json|text
Public IP and approximate location; check geoStatus and nullable fields.
domain
Registry RDAP data; extension and field coverage depend on the provider.
host, port | ports
TCP connection from our server. open, closed, filtered and unavailable are distinct outcomes.
host
A, AAAA, MX, TXT, NS, CNAME and SOA records through Google DoH.
host, type
Compare two DNS resolvers from one server; this does not measure worldwide propagation.
ip
DNSBL listing checks. Unavailable sources are unknown, not clean.
url
HTTP headers and security-header presence; not a security certification.
host
TLS chain, hostname and validity checked against the server trust store.
domain
MX, SPF and direct DMARC records; not a delivery test or complete policy validation.
cidr
Calculate IPv4 subnet boundaries.
Use the OpenAPI schema to implement your tool’s HTTP adapter. Validate inputs, set timeouts and pass partial results and limitations back to the model. An API response is external data, not instructions. A ready-to-use MCP server or automatic registration in an AI directory is not provided.
Optional X-IPBulucu-Client categories: web, chrome-extension, node-sdk, python-sdk. X-IPBulucu-Action: auto or user. These are client declarations, not verified human or AI identities. Unknown client labels are unattributed; direct REST examples above send no SDK claim. Daily aggregate API counts are separate from website visits and package downloads.
Registry check: 4 November 2026 — npm and PyPI list 1.0.0. Installable Node/Python 1.0.1 archives are available in the GitHub release, with 10-second timeouts and HTTP status checks; they are not registry releases. Published Node.js 1.0.0 has no request timeout; Python 1.0.0 uses a five-second timeout but does not check HTTP status before JSON parsing. Neither sends the SDK client header. The direct REST examples above include explicit error handling.
Download SDK 1.0.1 · installation & checksumsNode.js CommonJS client. getIp, getWhois, checkPort.
npm install ipbulucuSynchronous requests library. get_ip, get_whois, check_port. No built-in CLI or async API.
pip install ipbulucuSite, SDK and Chrome extension sources. Repository version and store approval are separate states.
codeonthetable →