> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api-docs.botbye.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api-docs.botbye.com/_mcp/server.

# check

POST https://verify.botbye.com/api/v1/protect/good-bot
Content-Type: application/json

# Check a Good Bot

Tells whether a request that declares itself a known crawler (a search engine, an SEO crawler and the like) really comes from that crawler.

Call it from your backend with the visitor's IP address and `User-Agent`, before any page script could run — for example to let a genuine search-engine crawler through while treating an impostor that only copies its `User-Agent` as a bot.

## Endpoint

```
POST https://verify.botbye.com/api/v1/protect/good-bot
```

This endpoint is served from `verify.botbye.com`, the same host as the request evaluation API, not from `api.botbye.com`.

## Authentication

Send a personal access token in the `X-Api-Key` request header.

## Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ip` | string | Yes | The visitor's IP address as your backend received it: a single IPv4 or IPv6 address, without a zone id or a prefix length |
| `user_agent` | string | Yes | The visitor's `User-Agent` header, unchanged |

## Response Structure

| Field | Type | Description |
| --- | --- | --- |
| `result` | string | `GOOD_BOT`, `FAKE_BOT` or `UNKNOWN` |
| `error` | object | Present only when the request could not be checked |
| `error.message` | string | What was wrong with the call |

| `result` | Meaning |
| --- | --- |
| `GOOD_BOT` | The request comes from the crawler its `User-Agent` declares |
| `FAKE_BOT` | The `User-Agent` declares a known crawler, but the request does not come from it |
| `UNKNOWN` | No known crawler is declared, or the request could not be checked; judge it as ordinary traffic |

## Errors

The endpoint answers `200` even when the call fails: the response then carries `result: "UNKNOWN"` and an `error` naming the problem, for example:

- `Missing header 'X-Api-Key'`, `Invalid API key`, `API key expired`
- `Invalid request body: field 'ip' is not an IP address`
- `Invalid request body: missing or invalid field 'user_agent'`
- `Internal validation error`

Since `UNKNOWN` is also the answer for ordinary traffic, check for `error` to tell a failed call from a checked one.

> **Accepted permissions**
> Any valid API token (no specific permission required).

Reference: https://api-docs.botbye.com/bot-bye-api/protection/good-bots/check

## Authentication

- `X-Api-Key` header (required) — Personal access token. Create it in your BotBye account under **Profile → Personal Access Tokens**, tick the scopes the endpoints you call require (see each endpoint's **Token scope**), and send the token in the `X-Api-Key` request header. A token works only for the account it was created in.

## Request

### Body (application/json)

This endpoint expects an object.

- `ip` (string, required) — The visitor's IPv4 or IPv6 address
- `user_agent` (string, required) — The visitor's `User-Agent` header

## Response

### 200

success

- `result` (enum, required)
  - Allowed values: `GOOD_BOT`, `FAKE_BOT`, `UNKNOWN`
- `error` (ApiV1ProtectGoodBotPostResponsesContentApplicationJsonSchemaError, optional)

## Types

### ApiV1ProtectGoodBotPostResponsesContentApplicationJsonSchemaError

- `message` (string, required)

## Examples

### Verified crawler

**Request**

```json
{
  "ip": "66.249.66.1",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}
```

**Response**

```json
{
  "result": "GOOD_BOT"
}
```

**SDK Code**

```python Verified crawler
import requests

url = "https://verify.botbye.com/api/v1/protect/good-bot"

payload = {
    "ip": "66.249.66.1",
    "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Verified crawler
const url = 'https://verify.botbye.com/api/v1/protect/good-bot';
const options = {
  method: 'POST',
  headers: {'X-Api-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"ip":"66.249.66.1","user_agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Verified crawler
package main

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

func main() {

	url := "https://verify.botbye.com/api/v1/protect/good-bot"

	payload := strings.NewReader("{\n  \"ip\": \"66.249.66.1\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Verified crawler
require 'uri'
require 'net/http'

url = URI("https://verify.botbye.com/api/v1/protect/good-bot")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ip\": \"66.249.66.1\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}"

response = http.request(request)
puts response.read_body
```

```java Verified crawler
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://verify.botbye.com/api/v1/protect/good-bot")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ip\": \"66.249.66.1\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}")
  .asString();
```

```php Verified crawler
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://verify.botbye.com/api/v1/protect/good-bot', [
  'body' => '{
  "ip": "66.249.66.1",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Verified crawler
using RestSharp;

var client = new RestClient("https://verify.botbye.com/api/v1/protect/good-bot");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ip\": \"66.249.66.1\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Verified crawler
import Foundation

let headers = [
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "ip": "66.249.66.1",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://verify.botbye.com/api/v1/protect/good-bot")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Impostor

**Request**

```json
{
  "ip": "203.0.113.7",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}
```

**Response**

```json
{
  "result": "FAKE_BOT"
}
```

**SDK Code**

```python Impostor
import requests

url = "https://verify.botbye.com/api/v1/protect/good-bot"

payload = {
    "ip": "203.0.113.7",
    "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Impostor
const url = 'https://verify.botbye.com/api/v1/protect/good-bot';
const options = {
  method: 'POST',
  headers: {'X-Api-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"ip":"203.0.113.7","user_agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Impostor
package main

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

func main() {

	url := "https://verify.botbye.com/api/v1/protect/good-bot"

	payload := strings.NewReader("{\n  \"ip\": \"203.0.113.7\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Impostor
require 'uri'
require 'net/http'

url = URI("https://verify.botbye.com/api/v1/protect/good-bot")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ip\": \"203.0.113.7\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}"

response = http.request(request)
puts response.read_body
```

```java Impostor
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://verify.botbye.com/api/v1/protect/good-bot")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ip\": \"203.0.113.7\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}")
  .asString();
```

```php Impostor
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://verify.botbye.com/api/v1/protect/good-bot', [
  'body' => '{
  "ip": "203.0.113.7",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Impostor
using RestSharp;

var client = new RestClient("https://verify.botbye.com/api/v1/protect/good-bot");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ip\": \"203.0.113.7\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Impostor
import Foundation

let headers = [
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "ip": "203.0.113.7",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://verify.botbye.com/api/v1/protect/good-bot")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Call failed

**Request**

```json
{
  "ip": "not-an-ip",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}
```

**Response**

```json
{
  "result": "UNKNOWN",
  "error": {
    "message": "Invalid request body: field 'ip' is not an IP address"
  }
}
```

**SDK Code**

```python Call failed
import requests

url = "https://verify.botbye.com/api/v1/protect/good-bot"

payload = {
    "ip": "not-an-ip",
    "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}
headers = {
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Call failed
const url = 'https://verify.botbye.com/api/v1/protect/good-bot';
const options = {
  method: 'POST',
  headers: {'X-Api-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"ip":"not-an-ip","user_agent":"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Call failed
package main

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

func main() {

	url := "https://verify.botbye.com/api/v1/protect/good-bot"

	payload := strings.NewReader("{\n  \"ip\": \"not-an-ip\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Call failed
require 'uri'
require 'net/http'

url = URI("https://verify.botbye.com/api/v1/protect/good-bot")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ip\": \"not-an-ip\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}"

response = http.request(request)
puts response.read_body
```

```java Call failed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://verify.botbye.com/api/v1/protect/good-bot")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ip\": \"not-an-ip\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}")
  .asString();
```

```php Call failed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://verify.botbye.com/api/v1/protect/good-bot', [
  'body' => '{
  "ip": "not-an-ip",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Call failed
using RestSharp;

var client = new RestClient("https://verify.botbye.com/api/v1/protect/good-bot");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ip\": \"not-an-ip\",\n  \"user_agent\": \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Call failed
import Foundation

let headers = [
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "ip": "not-an-ip",
  "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://verify.botbye.com/api/v1/protect/good-bot")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```