Endpoints

The Ipregistry API provides 8 different endpoints to use based on your needs:

  • Single IP Lookup

    Retrieve the information associated with the specified IP address.

  • Batch IP Lookup

    Retrieves details for several IP addresses in a single request, optimizing bulk IP address search.

  • Origin IP Lookup

    Retrieves information from the IP address originating your request. Ideal for client-side applications, such as user browsers or apps used by your audience.

  • User-Agent Parsing

    Decodes the provided user-agent strings, enhancing website user insights and analysis.

  • Origin User-Agent Parsing

    Analyzes the user-agent data from received client-side requests, elevating web engagement metrics and user experience insights.

  • Single ASN Lookup

    Queries the specified Autonomous System Number for in-depth insights.

  • Batch ASN Lookup

    Efficiently pulls data for multiple Autonomous System Numbers in one go.

  • Origin ASN Lookup

    Extracts the Autonomous System information tied to the requester's IP.

Single IP 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 (HTTP GET method):

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

Every request to the single IP lookup endpoint consumes 1 credit.

Batch IP Lookup

The batch IP lookup endpoint allows you to group up to 1024 IP search requests into a single request (you can mix up IPv4 and IPv6 addresses). This can really speed up the processing of bulk IP lookup.

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 (HTTP GET method):

https://api.ipregistry.co/66.165.2.7,2a01:e35:2f22:e3d0::2,1.1.1.1?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", "2a01:e35:2f22:e3d0::2", "1.1.1.1"]' \
     --header "Content-Type: application/json" \
     --request POST "https://api.ipregistry.co/?key=YOU_API_KEY"
A batch IP lookup request costs as many credits as IP addresses specified plus one. For instance, the example above costs 4 credits and not 3.

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 IP 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 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, look at the following endpoints.

This endpoint is intended for client browser requests. If you call it from a server, the response will reflect the IP of the source, essentially your server's IP. Every IP information retrieval via this endpoint consumes 1 credit.

User-Agent Parsing

User-Agent parsing 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).

Requests to this endpoint must be performed with an HTTP POST. The body payload accepts a list containing up to 256 entries:

curl --data '["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"]' \
     --header "Content-Type: application/json" \
     --request POST "https://api.ipregistry.co/user_agent?key=YOUR_API_KEY"
For every single user-agent value you submit for parsing, it will cost 1 credit. If you provide multiple user-agent values, the cost will be 1 credit plus an additional credit for each user-agent value you submit.

Origin User-Agent Parsing

Similarly to the Origin IP lookup endpoint, you can perform a request from client-side (i.e. user browser) to get the parsed user-agent data without extra steps:

https://api.ipregistry.co/user_agent?key=YOUR_API_KEY
This endpoint is designed for client browser calls. If called from a server, the response will be based on the user-agent of the application sending the request from your server. Each call to the user-agent parsing endpoint uses 1 credit.

Single ASN Lookup

This endpoints is used to look up AS data by AS number (ASN). To call this endpoint, simply attach an ASN to the API's base URL (HTTP GET method):

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

Every request to the single AS lookup endpoint consumes 1 credit.

Batch AS Lookup

The batch AS lookup feature consolidates up to 16 ASN queries into one, streamlining and accelerating the processing of bulk AS lookup.

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

Comma-separated parameter

In order to process ASN in bulk with this method, simply append multiple comma-separated ASNs to the API's base URL (HTTP GET method):

https://api.ipregistry.co/AS7,AS42?key=YOUR_API_KEY

JSON array as POST body

To make a batch request you can also POST a JSON array containing all ASNs 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 ASNs with a single API call:

curl --data '["AS1", "AS6", "AS42"]' \
     --header "Content-Type: application/json" \
     --request POST "https://api.ipregistry.co/?key=YOU_API_KEY"
A batch AS lookup request costs as many credits as ASN specified in input plus one. For instance, the example above costs 4 credits and not 3.

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

Origin AS Lookup

This endpoint returns details for the Autonomous System associated with the calling address. It allows you to look up your own —or a visitor to your site AS data without knowing the ASN or IP address in advance:

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