apyhub
Back

Retrieve IP Address Location and Network Details API

What it does

IP Location and ASN looks up geographic and network details for a single IP address or a batch of up to 100,000 IPs. Send an IP and get back fields such as asn, isp, asn_org, country, country_name, region, city, latitude, longitude, timezone, and is_datacenter when data is available.

Use the single-IP endpoint when you need a quick check on one address. Use the batch endpoint when you are processing logs, fraud signals, analytics events, or security reports at scale. Batch results come back in the same order as your input IPs, and duplicate IPs are only checked once against quota. Invalid or private IPs are returned as found: false in batch responses.

The service is designed for caching and repeated lookups: IP location results can be cached for 6 hours, and the response headers expose rate-limit usage. That makes it practical for enrichment pipelines, abuse detection, geotargeting, and dashboarding where you need location context alongside network ownership.

For single lookups, the response is the IP record itself. For batch lookups, the response is a results array with one object per input IP, each including ip and found, plus the location and network fields when the address is known.

▣ ENDPOINT 01 / 02
GET
Location and network for any IP
https://api.eu.apyhub.com/hproxy/retrieve-ip-location-network-details/:ip

QUICKSTART

GUIDE

Quickstart

Look up the location and network details for a single IP address by putting the IP in the path.

curl -X GET "https://api.eu.apyhub.com/hproxy/retrieve-ip-location-network-details/:ip" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with IP location and ASN details. The top-level ip field is a string for the looked-up address; the other fields are asn, isp, city, region, asn_org, country, latitude, timezone, longitude, country_name, and is_datacenter, and each may be null when the IP is not found or details are unavailable.

{
  "ip": "45.79.12.44",
  "asn": 63949,
  "isp": "Akamai Technologies, Inc.",
  "city": "Dallas",
  "region": "Texas",
  "asn_org": "Akamai Technologies, Inc.",
  "country": "US",
  "latitude": 32.7797,
  "timezone": "America/Chicago",
  "longitude": -96.8022,
  "country_name": "United States",
  "is_datacenter": false
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Looks up location and network information for a single IP address and returns it as JSON. The response includes the looked-up ip plus geographic, ASN, ISP, timezone, and datacenter-related fields.

Path Parameter(s)

AttributeTypeMandatoryDescription
ipStringYesIP address to look up.

Response

Returns a JSON object with an ip string field plus optional location and network fields: asn (integer or null), isp (string or null), city (string or null), region (string or null), asn_org (string or null), country (string or null), latitude (number or null), timezone (string or null), longitude (number or null), country_name (string or null), and is_datacenter (boolean or null).

ParameterTypeDescription
ipStringThe IP address that was looked up.
asnIntegerAutonomous System Number identifying the network operator. May be null.
ispStringInternet Service Provider name. May be null.
cityStringCity name where the IP is registered. May be null.
regionStringState or region within the country. May be null.
asn_orgStringOrganization name running the ASN. May be null.
countryString2-letter ISO country code. May be null.
latitudeNumberGeographic latitude coordinate. May be null.
timezoneStringIANA timezone identifier. May be null.
longitudeNumberGeographic longitude coordinate. May be null.
country_nameStringFull country name. May be null.
is_datacenterBooleanWhether the IP belongs to a commercial cloud/datacenter provider. May be null.
▣ ENDPOINT 02 / 02
POST
Batch: up to 100 000 addresses per call
https://api.eu.apyhub.com/hproxy/retrieve-ip-location-network-details/batch/ips

QUICKSTART

GUIDE

Quickstart

Look up location and network info for one or more IP addresses by sending them as a JSON array under ips.

curl -X POST "https://api.eu.apyhub.com/hproxy/retrieve-ip-location-network-details/batch/ips" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ips":["8.8.8.8"]}'

What you'll get back

Returns a JSON object with a results array. Each item is an object containing at least ip and found; when an IP is found, the object may also include fields like asn, isp, city, region, country, and other network/location details.

{
  "results": [
    {
      "ip": "8.8.8.8",
      "country": "US",
      "country_name": "United States",
      "latitude": 37.751,
      "longitude": -97.822,
      "timezone": "America/Chicago",
      "asn": 15169,
      "asn_org": "Google LLC",
      "isp": "Google LLC",
      "is_datacenter": true
    }
  ]
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
ips*
Up to 100 000 IP addresses. A bare JSON array is also accepted. More than 100 000 returns 400 batch_too_large.

About this endpoint

What it does

Looks up location and network information for up to 100,000 IP addresses in a single POST request. The response returns an array of results in the exact same order as the input IPs.

Request Body

ParameterTypeMandatoryDescription
ipsString ArrayYesArray of up to 100,000 IP addresses as strings. A bare JSON array is also accepted instead of an object wrapper.

Response

Returns a JSON object with a required results array field. Each array item is an object representing one IP lookup result, and the array order matches the input IP order.

ParameterTypeDescription
resultsObject ArrayArray of lookup results in the exact same order as the input IPs.
results[].ipStringThe IP address looked up.
results[].foundBooleanTrue if the IP was found in the database. False means this IP has no location data.
results[].countryString2-letter country code.
results[].country_nameStringFull country name.
results[].regionStringState or region.
results[].cityStringCity name.
results[].latitudeNumberGeographic latitude.
results[].longitudeNumberGeographic longitude.
results[].timezoneStringIANA timezone.
results[].asnIntegerAutonomous System Number.
results[].asn_orgStringOrganization name running the network.
results[].ispStringInternet Service Provider or cloud provider name.
results[].is_datacenterBooleanTrue if from a major cloud/datacenter provider.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.