Endpoints

The Ipregistry API looks up IP addresses and Autonomous Systems and parses User-Agent strings. Each resource can be queried one value at a time, in batches, or for the client making the request.

At a glance

8 endpoints under https://api.ipregistry.co. Every request needs your API key.

Single AS lookup

Look up one Autonomous System by its number.

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

Append an AS number, prefixed with AS, to the API base URL.

Cost
1 credit
Call from
Server Keeps your API key private

Batch AS lookup

Look up to 16 Autonomous Systems in one request.

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

Append several comma-separated AS numbers to the API base URL, or POST them as a JSON array. AS numbers and IP addresses can be mixed in the same batch.

Cost
n + 1 credits One credit per AS number, plus one per request: 3 AS numbers cost 4 credits.
Limit
16 AS numbers per request
Call from
Server Keeps your API key private

JSON array as POST body

curl --data '["AS1", "AS6", "AS42"]' \
 --header "Content-Type: application/json" \
 --request POST "https://api.ipregistry.co/?key=YOUR_API_KEY"
  • JSON responses wrap the answers in a results array, one AS data object per requested value. XML responses wrap <result> elements in a <results> element.

Origin AS lookup

Look up the Autonomous System of the address making the request.

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

Returns the Autonomous System of the calling address, so you can look up your own network, or a visitor's, without knowing the IP address or AS number in advance.

Cost
1 credit
Call from
Client (browser, app)

Calling from the browser or an app exposes your API key to anyone who opens it. Origin filtering does not prevent that: it is enforced by browsers only, so scripts can still use the key. To keep the key private, read the visitor's IP address on your server and call the Single IP lookup: its connection.asn field gives the Autonomous System.

  • Called from a server, the response describes your server's network, not your visitor's.

Single IP lookup

Look up one IPv4 or IPv6 address.

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

The primary Ipregistry endpoint. Append any IPv4 or IPv6 address to the API base URL.

Cost
1 credit
Call from
Server Keeps your API key private

Batch IP lookup

Look up to 1,024 IP addresses in one request.

GET https://api.ipregistry.co/66.165.2.7,2a01:e35:2f22:e3d0::2,1.1.1.1?key=YOUR_API_KEY

Append several comma-separated addresses to the API base URL, or POST them as a JSON array. IPv4 and IPv6 addresses can be mixed, which makes bulk processing much faster.

Cost
n + 1 credits One credit per address, plus one per request: 3 addresses cost 4 credits.
Limit
1,024 IP addresses per request
Call from
Server Keeps your API key private

JSON array as POST body

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=YOUR_API_KEY"
  • JSON responses wrap the answers in a results array, one IP data object per requested value. XML responses wrap <result> elements in a <results> element.
  • See Bulk Lookups for batching strategies and error handling.

Origin IP lookup

Look up the address making the request, plus its parsed User-Agent.

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

Returns data for the calling address, so you can look up your own address, or a visitor's, without knowing it in advance. The response also includes User-Agent fields for the client that made the request.

Cost
1 credit
Call from
Client (browser, app)

Calling from the browser or an app exposes your API key to anyone who opens it. Origin filtering does not prevent that: it is enforced by browsers only, so scripts can still use the key. To keep the key private, read the visitor's IP address and User-Agent header on your server and call the Single IP lookup and User-Agent parsing endpoints.

  • Called from a server, the response describes your server's address, not your visitor's.

User-Agent parsing

Parse up to 256 User-Agent strings in one request.

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

Detect the browser, device and operating system behind any User-Agent string, for native app download prompts, tailored content, crawler protection and more. POST a JSON array of strings.

Cost
n + 1 credits One credit per User-Agent, plus one per request.
Limit
256 User-Agents per request
Call from
Server Keeps your API key private

Request

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"

Origin User-Agent parsing

Parse the User-Agent of the client making the request.

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

Call it from the browser or app to get the parsed User-Agent of that client, with no extra step. Add a ua query parameter to parse a specific value instead.

Cost
1 credit
Call from
Client (browser, app)

Calling from the browser or an app exposes your API key to anyone who opens it. Origin filtering does not prevent that: it is enforced by browsers only, so scripts can still use the key. To keep the key private, forward the visitor's User-Agent header from your server to the User-Agent parsing endpoint.

  • Called from a server without ua, the response describes your server's HTTP client.