Network & DNS
/api/v1/asn-lookupPacketFlo ASN Lookup API
The network operator announcing a domain or IP's address block. asn is the bare AS number as a string (for example "13335"), and source is "live" or "fallback" (an offline dataset used when the live lookup is unavailable).
| Parameter | Type | Required | Description |
|---|---|---|---|
target | string | Yes | IP address or domain. |
Example request
curl "https://packetflo.io/api/v1/asn-lookup?target=1.1.1.1&api_key=YOUR_API_KEY"
Example response
{ "ok": true, "data": { "ip": "1.1.1.1", "source": "live", "asn": "13335", "asName": "Cloudflare, Inc.", "asDomain": "cloudflare.com", "countryCode": "AU", "country": "Australia", "continentCode": "OC", "continent": "Oceania", "resolvedFrom": null }, "meta": { "tool": "asn-lookup", "version": "v1" } }
Reading the result
Looks up the network owning a public IP, or the selected IP of a hostname. This endpoint accepts IPs and hostnames, not an ASN such as AS13335.
Response fields
| Field | What it tells you |
|---|---|
ip / resolvedFrom | The address looked up and the original hostname. resolvedFrom is null for an IP input. |
source | live for the primary provider or fallback for the local database, which may contain older data. |
asn / asName / asDomain | Network ownership information; unavailable values are null. asDomain is inferred from the organization, not verified ownership. |
country / countryCode / continent / continentCode | Approximate geographic information. Unknown fields are null. |
Scope and limits
Uses IP2Location with a local DB-IP fallback. Country data does not locate a person or device precisely. VPNs, mobile networks and hosting providers can affect the reported location.
Authentication and errors
Send your key in the x-api-key header, or the supported api_key query parameter. Each request uses 1 credit from the key's shared 300-credit rolling 24-hour budget. Credits are charged before parameter validation. Successful responses and quota errors include usage headers; GET and OPTIONS support CORS.
| API status | Meaning |
|---|---|
200 | The diagnostic returned a result in data, with ok: true and version information in meta. Read the diagnostic fields to determine the target's condition. |
400 | Invalid or blocked input, or a lookup/check failure that could not be returned as a diagnostic result. Read error for details. |
401 | Missing, invalid or revoked API key. |
429 | The request would exceed the key's available credit budget. |