Endpoints

The Ipregistry API offers 4 different endpoints to use based on your needs:

Although requests over HTTP are allowed for legacy reasons, we recommend making all your requests over HTTPS to ensure privacy and best performances.

Single Lookup

This is the primary Ipregistry endpoint. It is used to look up any given IPv4 or IPv6 addresses. To call this endpoint, simply attach an IP address to the API's base URL:

https://api.ipregistry.co/66.165.2.7?key=YOUR_API_KEY

Batch Lookup

The batch API endpoint allows you to group up to 256 Ipregistry API requests into a single request. This can really speed up the processing of bulk IP look ups.

We support 2 methods to pass values to a batch request: comma-separated and JSON array.

Comma-separated parameter

In order to process IP addresses in bulk with this method, simply append multiple comma-separated IP addresses to the API's base URL:

https://api.ipregistry.co/66.165.2.7,1.1.1.1,8.8.4.4?key=YOUR_API_KEY

JSON array as POST body

To make a batch request you can also POST a JSON array containing all IP addresses you'd like to get the data for. Here's an example that uses cURL and the batch endpoint to get information about 3 different IP addresses with a single API call:

curl --data '["66.165.2.7", "1.1.1.1", "8.8.4.4"]' \
     --header "Content-Type: application/json" \
     --request POST "https://api.ipregistry.co/?key=YOU_API_KEY"
Note that every IP address specified in a batch request counts as an individual IP look up. As a consequence, a batch costs as many credits as IP addresses specified. For instance, the example above costs 3 credits.

Responses: for JSON outputs, the response includes a results field that has for value a JSON Array that contains one IP data object per requested IP address. Similarly, for XML outputs, a main element <results>...</results> wraps result elements.

Origin Lookup

This endpoint returns details for the calling address. It allows you to look up your own (or a visitor to your site) IP address details without knowing the IP address in advance:

https://api.ipregistry.co/?key=YOUR_API_KEY

In addition to IP related data, this endpoint also returns user-agent specific data. This information may be used to filter users or enrich pages based on the application type, operating system, software vendor and revision.

If you are interested by User-Agent data only, we provide a dedicated endpoint at https://api.ipregistry.co/user_agent.

User-Agent Lookup

This endpoint allows detecting any browser, device & OS in real-time to bring user experience to perfection (e.g. native app download, tailored advertising, crawler protection, and more).

Client-side

From client-side, a simple HTTP GET request to the user_agent endpoint returns the information:

https://api.ipregistry.co/user_agent?key=YOUR_API_KEY

Server-side

On server-side, you need to pass the user-agent values to parse. The request must be performed with an HTTP POST. The payloads accepts up to 256 entries:

curl --data '["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"]' \
     --header "Content-Type: application/json" \
     --request POST "https://api.ipregistry.co/user_agent?key=YOUR_API_KEY"