Network & DNS

GET/api/v1/asn-lookup

PacketFlo ASN Lookup API

Cost: 1 credit per request

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).

ParameterTypeRequiredDescription
targetstringYesIP 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

FieldWhat it tells you
ip / resolvedFromThe address looked up and the original hostname. resolvedFrom is null for an IP input.
sourcelive for the primary provider or fallback for the local database, which may contain older data.
asn / asName / asDomainNetwork ownership information; unavailable values are null. asDomain is inferred from the organization, not verified ownership.
country / countryCode / continent / continentCodeApproximate 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 statusMeaning
200The diagnostic returned a result in data, with ok: true and version information in meta. Read the diagnostic fields to determine the target's condition.
400Invalid or blocked input, or a lookup/check failure that could not be returned as a diagnostic result. Read error for details.
401Missing, invalid or revoked API key.
429The request would exceed the key's available credit budget.
What Is My IP Address