Skip to content
Start here

Get ASN Subnets

client.Intel.ASN.Subnets.Get(ctx, asn, query) (*ASNSubnetGetResponse, error)
GET/accounts/{account_id}/intel/asn/{asn}/subnets

Get ASN Subnets.

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)
Intel WriteIntel Read
ParametersExpand Collapse
ASN ASN
query ASNSubnetGetParams
AccountID param.Field[string]

Identifier.

maxLength32
ReturnsExpand Collapse
type ASNSubnetGetResponse struct{…}
ASN ASNOptional
Count float64Optional

Total results returned based on your search parameters.

IPCountTotal int64Optional
Page float64Optional

Current page within paginated list of results.

PerPage float64Optional

Number of results per page of results.

Subnets []stringOptional

Get ASN Subnets

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  subnet, err := client.Intel.ASN.Subnets.Get(
    context.TODO(),
    int64(0),
    intel.ASNSubnetGetParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", subnet.ASN)
}
{
  "asn": 0,
  "count": 1,
  "ip_count_total": 0,
  "page": 1,
  "per_page": 20,
  "subnets": [
    "192.0.2.0/24",
    "2001:DB8::/32"
  ]
}
Returns Examples
{
  "asn": 0,
  "count": 1,
  "ip_count_total": 0,
  "page": 1,
  "per_page": 20,
  "subnets": [
    "192.0.2.0/24",
    "2001:DB8::/32"
  ]
}