Skip to content
Start here

Get bot details

client.Radar.Bots.Get(ctx, botSlug, query) (*BotGetResponse, error)
GET/radar/bots/{bot_slug}

Retrieves the requested bot information.

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
botSlug string

Bot slug.

maxLength100
query BotGetParams
Format param.Field[BotGetParamsFormat]optional

Format in which results will be returned.

const BotGetParamsFormatJson BotGetParamsFormat = "JSON"
const BotGetParamsFormatCsv BotGetParamsFormat = "CSV"
ReturnsExpand Collapse
type BotGetResponse struct{…}
Bot BotGetResponseBot
Category string

The category of the bot.

Description string

A summary for the bot (e.g., purpose).

Kind string

The kind of the bot.

Name string

The name of the bot.

Operator string

The organization that owns and operates the bot.

OperatorURL string

The link to the bot documentation.

Slug string

A kebab-case identifier derived from the bot name.

UserAgentPatterns []string
UserAgents []string

Get bot details

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  bot, err := client.Radar.Bots.Get(
    context.TODO(),
    "gptbot",
    radar.BotGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", bot.Bot)
}
{
  "result": {
    "bot": {
      "category": "AI_CRAWLER",
      "description": "OpenAI/ChatGPT's web crawler",
      "kind": "AGENT",
      "name": "GPTBot",
      "operator": "OpenAI",
      "operatorUrl": "https://platform.openai.com/docs/bots",
      "slug": "gptbot",
      "userAgentPatterns": [
        "GPTBot"
      ],
      "userAgents": [
        "GPTBot"
      ]
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "bot": {
      "category": "AI_CRAWLER",
      "description": "OpenAI/ChatGPT's web crawler",
      "kind": "AGENT",
      "name": "GPTBot",
      "operator": "OpenAI",
      "operatorUrl": "https://platform.openai.com/docs/bots",
      "slug": "gptbot",
      "userAgentPatterns": [
        "GPTBot"
      ],
      "userAgents": [
        "GPTBot"
      ]
    }
  },
  "success": true
}