AI bots do not run JavaScript and mostly do not load images. The tracking script therefore does not see them. For Lunaboard to show them, your server must send it the requests.
Three kinds of AI bots
| Purpose | Examples | What it means |
|---|---|---|
| Training and bulk crawl | GPTBot, ClaudeBot, Meta-ExternalAgent, Amazonbot | Data collection. It brings no traffic. |
| Search index | OAI-SearchBot, PerplexityBot, Claude-SearchBot | Decides whether the website appears in answers. |
| User question | ChatGPT-User, Claude-User, Perplexity-User | Someone asked an assistant and it opened the page. |
Sending requests
POST /hits accepts one request, an array of requests or an object with a hits array. One batch can contain at most 500 items.
| Field | Required | Description |
|---|---|---|
path | Yes | Request path, for example /aukce/123. |
user_agent | No | The User-Agent header. Without it, the request is counted as a bot. |
ip | No | IP address of the client. It is used to verify a bot against published ranges and to recognize data centers. It is not stored. |
status | No | Response code. The default is 200. |
bytes | No | Response size in bytes. |
time | No | Time of the request. Without it, the time of receipt is used. |
count | No | Number of identical requests, when you send them already added up. |
curl -X POST https://www.lunaboard.com/api/v1/hits \
-H "Authorization: Bearer luna_VAS_KLIC" \
-H "Content-Type: application/json" \
-d '{
"hits": [
{"path": "/aukce/123", "user_agent": "Mozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)", "ip": "203.0.113.7", "status": 200, "bytes": 18234, "time": "2026-12-02T08:15:00Z"},
{"path": "/domena/priklad", "user_agent": "Mozilla/5.0 (compatible; ClaudeBot/1.0; [email protected])", "ip": "203.0.113.9", "status": 200, "count": 3}
]
}'
HTTP/1.1 202 Accepted
{"accepted": 4, "bots": 1, "ai": 3, "humans": 0, "errors": 0}
The response summarizes how many requests Lunaboard accepted and how it divided them. In the sample, GPTBot comes from an address that does not belong to the ranges published by OpenAI, so it is counted among bots as spoofed and not among AI.
What happens to the requests
- Individual requests are not stored. Hourly totals by bot and response class and daily totals per page are stored.
- A page fetch in response to a question from an AI user is recorded individually with the page and the time.
- A bot that only pretends to be a known bot is included in one summary number and its pages are not stored.
- Responses with 4xx and 5xx codes also appear on the Errors page. Scanner attempts at addresses such as
/wp-adminor/.envhave their own section there.
How to send requests
Application middleware
The simplest way for a website in PHP. Collect requests after the response is finished and send them in batches from a queue, so that measurement does not slow down the website.
<?php
// Laravel middleware (terminable): požadavky se sbírají a posílají po dávkách z fronty,
// aby měření nezpomalovalo odpověď webu.
namespace App\Http\Middleware;
use App\Jobs\SendLunaHits;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class ReportHitsToLuna
{
public function handle(Request $request, Closure $next): Response
{
return $next($request);
}
public function terminate(Request $request, Response $response): void
{
SendLunaHits::dispatch([
'path' => '/'.ltrim($request->path(), '/'),
'user_agent' => (string) $request->userAgent(),
'ip' => $request->ip(),
'status' => $response->getStatusCode(),
'bytes' => strlen((string) $response->getContent()),
'time' => now()->toIso8601String(),
]);
}
}
Cloudflare Worker
When the website runs behind Cloudflare, a Worker in front of the website can send the requests. It also captures responses from the cache, which never reach the application.
Access log import
You can convert the lines of the web server log into batches from time to time and send them. Pass the time of the request in the time field and add up identical requests into count.
Recommendations
- Send all requests for pages, not only those from bots. Lunaboard does the division into humans, bots and AI.
- Do not send static files (images, styles, scripts).
- Pass the real IP address of the client. Behind a proxy, take it from a header that you trust.
- Stay within the limit of 600 API requests per minute per key. One batch counts as one request.