Docs / API reference
ASN Lookup
Returns the registry details of an Autonomous System: its owner, contact data, type and announced IP prefixes.
Overview#
An Autonomous System Number (ASN) identifies a network that routes traffic on the internet, such as an ISP, a cloud provider or a company. lookup/asn takes an asn parameter, written as AS6167 or simply 6167, and returns who runs that network: name, org, country, domain, contact email and phone, registry, type, creation date and status, plus a prefixes summary with the number of IPv4 and IPv6 ranges it announces.
When to use it#
- Investigating an IP result: take the
asn.asnfrom an IP Lookup response and see who owns it. - Building allow or deny logic around specific networks, such as known hosting providers.
- Enriching abuse reports and support cases with the responsible organization.
Reading the result#
typetells you what kind of network it is. Hosting and business networks behind consumer traffic are a classic sign of proxies or bots; ISP networks are typically ordinary users.prefixes.total,prefixes.ipv4andprefixes.ipv6give a sense of size. A very small network can be dedicated infrastructure.domain,emailandphoneare the contact details published in the registry, useful when you need to report abuse.statusandcreatedshow whether the registration is current and how old it is.
email and phone come from the network's registry record: the abuse contact first, then the technical, operations and administrative contacts. They are fetched on first request and kept for 30 days, and a registry outage never fails the call; the fields are then null, or hold the last value we had. created and status also come from the registry record.
Registry data is public and sometimes incomplete, so empty fields are normal.
Notes#
- Counts as one request. Test mode returns fake data, is free and contacts no external service.
- This method is not part of the Standard plan; it is available on the trial, Premium and pay-as-you-go plans. Calling it without access returns error 117 (
feature_not_available). - It does not raise events and has no custom rules or blacklist hooks.
- An empty or malformed value returns error 121 (
invalid_asn) with HTTP 200.
Request#
https://gurdx.cretip.com/api/lookup/asn
- Authenticate with the key parameter or an Authorization: Bearer header.
- Counts as 1 request.
- Available on: Free trial Premium Pay-as-you-go
Parameters#
| Name | Type | Description |
|---|---|---|
asn
required
query |
string |
The asn command is used to specify the AS Number you want to lookup. Sample value: AS6167 or 6167
|
Every method also accepts format, lang, mode, userID, callback. See Options.
Code samples#
curl -G "https://gurdx.cretip.com/api/lookup/asn" \
--data-urlencode "key=YOUR_API_KEY" \
--data-urlencode "asn=AS13335"
<?php
$response = file_get_contents('https://gurdx.cretip.com/api/lookup/asn?'.http_build_query(['key' => 'YOUR_API_KEY', 'asn' => 'AS13335']));
$result = json_decode($response, true);
if ($result['status'] === 'success') {
print_r($result['data']);
} else {
echo $result['code'].': '.$result['description'];
}
const params = new URLSearchParams({"key":"YOUR_API_KEY","asn":"AS13335"});
const res = await fetch(`https://gurdx.cretip.com/api/lookup/asn?${params}`);
const result = await res.json();
if (result.status === 'success') {
console.log(result.data);
} else {
console.error(result.code, result.description);
}
import requests
res = requests.get("https://gurdx.cretip.com/api/lookup/asn", params={"key": "YOUR_API_KEY", "asn": "AS13335"})
result = res.json()
if result["status"] == "success":
print(result["data"])
else:
print(result["code"], result["description"])
Response#
Success#
{
"data": {
"asn": "AS9112",
"name": "POZMAN",
"country": "PL",
"org": "Institute of Bioorganic Chemistry Polish Academy of Science, Poznan Supercomputing and Networking Center",
"phone": "+48 61 8582010",
"email": null,
"domain": "poznan.pl",
"status": "ASSIGNED",
"created": "2004-04-17T11:47:57Z",
"type": "education",
"registry": "RIPE",
"prefixes": {
"ipv4": [
"150.254.0.0/16",
"62.3.160.0/19"
],
"ipv6": [
"2001:808::/35"
],
"total": 3
}
},
"status": "success",
"executionTime": 0
}Error#
Errors are delivered with HTTP 200 — always check the status field.
{
"status": "error",
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}Response fields#
| Name | Type | Description |
|---|---|---|
data.asn |
string |
Autonomous System Number you're looking up. |
data.name |
string |
Name of the organization. |
data.country |
string |
Country code of the organization. |
data.org |
string |
Organization name. |
data.phone |
string |
Phone number contact for the organization. |
data.email |
string |
Email contact for the organization. |
data.domain |
string |
Domain associated with the organization. |
data.status |
string |
Status of the organization. |
data.created |
string |
Date of organization creation. |
data.type |
string |
Type of organization ("isp", "hosting", "business", "education", or "government"). |
data.registry |
string |
Registration information of the organization. |
data.prefixes.ipv4 |
array |
List of IPv4 prefixes associated with the organization. |
data.prefixes.ipv6 |
array |
List of IPv6 prefixes associated with the organization. |
data.prefixes.total |
integer |
Total number of prefixes associated with the organization. |
data.prefixes |
object |
— |
data |
object |
— |
status |
string |
Response status (success, or error).
|
executionTime |
integer |
Time taken to process the data (in milliseconds). |
Found a mistake? Tell us on the contact page. Contact