Skip to content
Start here

Get AS details by ASN

client.Radar.Entities.ASNs.Get(ctx, asn, query) (*EntityASNGetResponse, error)
GET/radar/entities/asns/{asn}

Retrieves the requested autonomous system information. (A confidence level below 5 indicates a low level of confidence in the traffic data - normally this happens because Cloudflare has a small amount of traffic from/to this AS). Population estimates come from APNIC (refer to https://labs.apnic.net/?p=526).

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse
asn int64

Single Autonomous System Number (ASN) as integer.

query EntityASNGetParams
Format param.Field[EntityASNGetParamsFormat]Optional

Format in which results will be returned.

const EntityASNGetParamsFormatJson EntityASNGetParamsFormat = "JSON"
const EntityASNGetParamsFormatCsv EntityASNGetParamsFormat = "CSV"
ReturnsExpand Collapse
type EntityASNGetResponse struct{…}
ASN EntityASNGetResponseASN
ASN int64
ConfidenceLevel int64
Country string
CountryName string
EstimatedUsers EntityASNGetResponseASNEstimatedUsers
Locations []EntityASNGetResponseASNEstimatedUsersLocation
LocationAlpha2 string
LocationName string
EstimatedUsers int64Optional

Estimated users per location.

EstimatedUsers int64Optional

Total estimated users.

Name string
OrgName string
Source string

Regional Internet Registry.

Website string
Aka stringOptional

Get AS details by ASN

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/radar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  asn, err := client.Radar.Entities.ASNs.Get(
    context.TODO(),
    int64(174),
    radar.EntityASNGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", asn.ASN)
}
{
  "result": {
    "asn": {
      "asn": 714,
      "confidenceLevel": 5,
      "country": "GB",
      "countryName": "United Kingdom",
      "estimatedUsers": {
        "locations": [
          {
            "locationAlpha2": "US",
            "locationName": "United States",
            "estimatedUsers": 16710
          }
        ],
        "estimatedUsers": 86099
      },
      "name": "Apple Inc.",
      "orgName": "orgName",
      "related": [
        {
          "asn": 174,
          "name": "Cogent-174",
          "aka": "aka",
          "estimatedUsers": 65345
        }
      ],
      "source": "RIPE",
      "website": "https://www.apple.com/support/systemstatus/",
      "aka": "aka"
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "asn": {
      "asn": 714,
      "confidenceLevel": 5,
      "country": "GB",
      "countryName": "United Kingdom",
      "estimatedUsers": {
        "locations": [
          {
            "locationAlpha2": "US",
            "locationName": "United States",
            "estimatedUsers": 16710
          }
        ],
        "estimatedUsers": 86099
      },
      "name": "Apple Inc.",
      "orgName": "orgName",
      "related": [
        {
          "asn": 174,
          "name": "Cogent-174",
          "aka": "aka",
          "estimatedUsers": 65345
        }
      ],
      "source": "RIPE",
      "website": "https://www.apple.com/support/systemstatus/",
      "aka": "aka"
    }
  },
  "success": true
}