请求
在代码里调用
把密钥放在环境变量 TAPCUB_API_KEY 里。接口地址前缀:https://api.pathclue.com/v1。
terminal
curl -X POST https://api.pathclue.com/v1/visitor/batch \
-H "Authorization: Bearer $TAPCUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"lines":"20.171.207.5\tMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.2; +https://openai.com/gptbot)\n203.0.113.9\tMozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)\n198.51.100.7\tMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0 Safari/537.36"}'index.mjs
const res = await fetch('https://api.pathclue.com/v1/visitor/batch', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TAPCUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"lines": "20.171.207.5\tMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.2; +https://openai.com/gptbot)\n203.0.113.9\tMozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)\n198.51.100.7\tMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0 Safari/537.36"
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());main.py
import os
import requests
res = requests.post(
"https://api.pathclue.com/v1/visitor/batch",
headers={"Authorization": f"Bearer {os.environ['TAPCUB_API_KEY']}"},
json={
"lines": "20.171.207.5\tMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.2; +https://openai.com/gptbot)\n203.0.113.9\tMozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)\n198.51.100.7\tMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0 Safari/537.36",
},
timeout=120,
)
res.raise_for_status()
print(res.json())index.php
<?php
$ch = curl_init('https://api.pathclue.com/v1/visitor/batch');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('TAPCUB_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'lines' => '20.171.207.5 Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.2; +https://openai.com/gptbot)
203.0.113.9 Mozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)
198.51.100.7 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0 Safari/537.36',
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status >= 300) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));main.go
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"lines":"20.171.207.5\tMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.2; +https://openai.com/gptbot)\n203.0.113.9\tMozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)\n198.51.100.7\tMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0 Safari/537.36"}`)
req, err := http.NewRequest("POST", "https://api.pathclue.com/v1/visitor/batch", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("TAPCUB_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
if res.StatusCode >= 300 {
panic(fmt.Sprintf("HTTP %d: %s", res.StatusCode, out))
}
fmt.Println(string(out))
}参数
请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
lines | string | 是 | — | 最多 1,000 行,一行一条:访问日志(Nginx / Apache combined 或 common、Cloudflare Logpush JSON、带 #Fields 行的 IIS W3C),或「IP<TAB>User-Agent」(用空格、逗号分隔也行)。按每 100 行计价。 |
rows | boolean | 否 | true | 返回每一行的结果。为 false 时只返回汇总(和读不出的行)。 |
返回
返回示例
成功的响应带 X-Credits-Charged(本次扣的点数)和 X-Credits-Balance(余额)两个响应头。出错时返回 {"error":{"code","message"}},一律不扣点。
response.json
{
"format": "pairs",
"rows": 3,
"parsed": 3,
"skipped": 0,
"summary": {
"classes": {
"human": 1,
"search": 0,
"ai_training": 2,
"ai_search": 0,
"ai_agent": 0,
"other": 0,
"unknown": 0
},
"ai": 2,
"verification": {
"verified": 1,
"spoofed": 1,
"unverifiable": 0
},
"bots": [
{
"id": "gptbot",
"name": "GPTBot",
"operator": "OpenAI",
"purpose": "ai_training",
"ai": true,
"requests": 2,
"verified": 1,
"spoofed": 1,
"unverifiable": 0,
"topNetworks": [
{
"network": "20.171.207.0/24",
"requests": 1
},
{
"network": "203.0.113.0/24",
"requests": 1
}
]
}
]
},
"results": [
{
"line": 1,
"ip": "20.171.207.5",
"class": "ai_training",
"bot": {
"id": "gptbot",
"name": "GPTBot",
"operator": "OpenAI",
"purpose": "ai_training",
"ai": true
},
"verification": "verified",
"range": "20.171.207.0/24"
},
{
"line": 2,
"ip": "203.0.113.9",
"class": "ai_training",
"bot": {
"id": "gptbot",
"name": "GPTBot",
"operator": "OpenAI",
"purpose": "ai_training",
"ai": true
},
"verification": "spoofed"
},
{
"line": 3,
"ip": "198.51.100.7",
"class": "human",
"bot": null,
"verification": null
}
],
"rangesFetched": "2026-11-17"
}价格和限制
怎么收费
| 价格 | 每 100 行 10 点 |
|---|---|
| 折合美元 | 约 $0.01 · $10 / 1,000 |
| 点数 | 免费或付费点数 |
| 限速 | 免费 10 次 / 分钟 · Plus 60 次 / 分钟 · Pro 300 次 / 分钟 |
| 免费账号每日上限 | 免费账号每把密钥每天 1,000 次 |
| 何时扣点 | 只有成功才扣,出错和超时不扣 |
用例
可以用来做什么
审查访问日志
看清多少流量是爬虫、哪些是冒充的。
每周 AI 报告
从自己的日志里跟踪 GPTBot、ClaudeBot 和 AI 来源访问。
补全数据
给导出的访客名单补上国家、网络和爬虫标记。
支持哪些日志格式?
常见的 Web 服务器访问日志(如 Nginx、Apache 的 combined 格式),以及纯 IP + UA 列表。解析不了的行会在结果里列出来。
怎么计价?
每 100 行 10 点,一次满 1,000 行是 100 点,约 0.1 美元。
日志和访客批量分析 API 怎么收费?
每次成功调用扣 每 100 行 10 点(约 $0.01),1 点约合 0.001 美元。调用失败——参数错误、目标网站打不开、超时或我们这边出错——都不扣。
可以免费试用吗?
可以。新账号送 300 点,每个账号每天再送 30 点,都能用在这个接口上。也可以不用密钥,直接在 tapcub.com 上用对应的免费工具试效果。
限速是多少?
免费账号每把密钥每分钟 10 次、每天 1,000 次;Plus 每分钟 60 次,Pro 每分钟 300 次。超出时返回 HTTP 429 并带 Retry-After 头,不扣点。
怎么拿到 API 密钥?
登录 TapCub 控制台,验证邮箱后在「工具套餐 → API」页新建密钥。密钥以 tck_ 开头,只显示一次;调用时放在 Authorization: Bearer 请求头里。