ASN Lookup

GET http://localhost/api/v1/asn/check scope: asn.check

Returns ASN ownership details and a hosting/datacenter-provider flag. Accepts either an ASN number or an IP to resolve.

Parameters

Field Type Optional Description
asn string Optional e.g. 15169 or AS15169. One of asn or ip is required.
ip string Optional Resolve the ASN for this IP instead. One of asn or ip is required.

Every parameter here is optional.

Example Request

curl "http://localhost/api/v1/asn/check?asn=15169" \
  -H "Authorization: Bearer wsk_xxx_xxx"
<?php
$ch = curl_init('http://localhost/api/v1/asn/check?asn=15169');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer wsk_xxx_xxx']);
$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
import requests

response = requests.get("http://localhost/api/v1/asn/check",
    headers={"Authorization": "Bearer wsk_xxx_xxx"},
    params={"asn": "15169"},
)

data = response.json()
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	client := &http.Client{}
	req, _ := http.NewRequest("GET", "http://localhost/api/v1/asn/check?asn=15169", nil)
	req.Header.Set("Authorization", "Bearer wsk_xxx_xxx")

	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	respBody, _ := io.ReadAll(resp.Body)
	fmt.Println(string(respBody))
}

Example Response

{
  "data": {
    "asn": 15169, "name": "GOOGLE", "country": "US",
    "registry": "arin", "allocated": "2000-03-30",
    "prefix": "8.8.8.0/24", "is_hosting_provider": true
  }
}