Response Headers

Alongside the JSON payload, the API adds HTTP headers that report credit usage and rate limit status, and identify what served the request for troubleshooting.

Sample response headers

HTTP/2 200
content-type: application/json
ipregistry-credits-consumed: 1
ipregistry-credits-remaining: 99999
ipregistry-pod: 6f9c8d7b5-x2k4q
ipregistry-region: us-ash
ipregistry-version: 1

Credits

Every successful request

Ipregistry-Credits-Consumed Example 1

The number of credits the request consumed. Batch requests consume one credit per value plus one.

Ipregistry-Credits-Remaining Example 99999

The number of credits left on your account once the request was processed.

Diagnostics

Every response, errors included

Ipregistry-Version Example 1

The API version that served the request.

Ipregistry-Region Example us-ash

The Ipregistry region that served the request: a country code followed by a location code, such as gb-lnd or jp-tyo.

Ipregistry-Pod Example 6f9c8d7b5-x2k4q

An internal identifier of the node that served the request. Include it when you contact support about a specific request.

Rate limit

Only when a rate limit is set on the API key

X-Rate-Limit-Limit Example 1000

How many lookups the key may make per time window. The window is currently one hour, but rely on X-Rate-Limit-Reset rather than assuming it.

X-Rate-Limit-Remaining Example 998

How many lookups are left in the current window.

X-Rate-Limit-Reset Example 2134

The number of seconds until the current window ends.

See Rate limiting / Throttling to set a limit on a key.

Reading headers from the browser

The API lists every header above in Access-Control-Expose-Headers, so client-side code can read them from a cross-origin request:

const response = await fetch('https://api.ipregistry.co/?key=YOUR_API_KEY');
console.log(response.headers.get('Ipregistry-Credits-Remaining'));