Bot Detection

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

Classifies a User-Agent string as an automation tool, HTTP library, or claimed search-engine crawler. Pass ip alongside user_agent to also verify a claimed crawler's identity via reverse-DNS.

Parameters

Field Type Optional Description
user_agent string Required
ip string Optional Enables reverse-DNS crawler identity verification.

Example Request

curl "http://localhost/api/v1/bot/check?user_agent=Mozilla%2F5.0+%28compatible%3B+Googlebot%2F2.1%3B+%2Bhttp%3A%2F%2Fwww.google.com%2Fbot.html%29&ip=66.249.66.1" \
  -H "Authorization: Bearer wsk_xxx_xxx"
<?php
$ch = curl_init('http://localhost/api/v1/bot/check?user_agent=Mozilla%2F5.0+%28compatible%3B+Googlebot%2F2.1%3B+%2Bhttp%3A%2F%2Fwww.google.com%2Fbot.html%29&ip=66.249.66.1');
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/bot/check",
    headers={"Authorization": "Bearer wsk_xxx_xxx"},
    params={"user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", "ip": "66.249.66.1"},
)

data = response.json()
package main

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

func main() {
	client := &http.Client{}
	req, _ := http.NewRequest("GET", "http://localhost/api/v1/bot/check?user_agent=Mozilla%2F5.0+%28compatible%3B+Googlebot%2F2.1%3B+%2Bhttp%3A%2F%2Fwww.google.com%2Fbot.html%29&ip=66.249.66.1", 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": {
    "user_agent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
    "ip": "66.249.66.1", "is_bot": true,
    "category": "verified_crawler", "matched_name": "Googlebot",
    "is_verified_crawler": true, "is_spoofed_crawler": false,
    "crawler_verification": {"ptr": "crawl-66-249-66-1.googlebot.com", "name_from_dns": "Googlebot"},
    "fraud_score": 0, "risk_score": 0,
    "reasons": ["No bot signals detected"]
  }
}