请求
在代码里调用
把密钥放在环境变量 TAPCUB_API_KEY 里。接口地址前缀:https://api.pathclue.com/v1。
terminal
curl -X POST https://api.pathclue.com/v1/site/email-auth \
-H "Authorization: Bearer $TAPCUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain":"example.com","dkimSelectors":"google"}'index.mjs
const res = await fetch('https://api.pathclue.com/v1/site/email-auth', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TAPCUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"domain": "example.com",
"dkimSelectors": "google"
}),
});
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/site/email-auth",
headers={"Authorization": f"Bearer {os.environ['TAPCUB_API_KEY']}"},
json={
"domain": "example.com",
"dkimSelectors": "google",
},
timeout=120,
)
res.raise_for_status()
print(res.json())index.php
<?php
$ch = curl_init('https://api.pathclue.com/v1/site/email-auth');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('TAPCUB_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'domain' => 'example.com',
'dkimSelectors' => 'google',
]),
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(`{"domain":"example.com","dkimSelectors":"google"}`)
req, err := http.NewRequest("POST", "https://api.pathclue.com/v1/site/email-auth", 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))
}参数
请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
domain | string | 是 | — | 发信的域名(填网址或邮箱也行)。 |
dkimSelectors | string | 否 | — | 要查的 DKIM 选择器,逗号分隔(最多 10 个)。默认查常见的(google、selector1、selector2、s1、s2、k1、default、dkim、mail)。 |
返回
返回示例
成功的响应带 X-Credits-Charged(本次扣的点数)和 X-Credits-Balance(余额)两个响应头。出错时返回 {"error":{"code","message"}},一律不扣点。
response.json
{
"domain": "example.com",
"spf": {
"found": true,
"record": "v=spf1 include:_spf.google.com ~all",
"lookups": 4,
"voidLookups": 0,
"terms": [
{
"term": "include:_spf.google.com",
"kind": "mechanism",
"name": "include",
"value": "_spf.google.com",
"qualifier": "pass",
"lookup": true
},
{
"term": "~all",
"kind": "mechanism",
"name": "all",
"value": null,
"qualifier": "softfail",
"lookup": false
}
],
"includes": [
{
"depth": 1,
"target": "include:_spf.google.com",
"record": "v=spf1 include:_netblocks.google.com … ~all",
"lookups": 3,
"state": "ok"
}
],
"issues": [
{
"level": "ok",
"key": "spfLookups",
"vars": {
"n": 4
}
}
]
},
"dmarc": {
"found": true,
"record": "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
"foundAt": "_dmarc.example.com",
"policy": {
"policy": "quarantine",
"subdomainPolicy": "quarantine",
"nonExistentPolicy": "quarantine",
"dkimAlignment": "r",
"spfAlignment": "r"
},
"tags": {
"v": "DMARC1",
"p": "quarantine",
"rua": "mailto:dmarc@example.com"
},
"issues": []
},
"dkim": {
"selectorsTried": [
"google"
],
"source": "given",
"found": [
{
"selector": "google",
"name": "google._domainkey.example.com",
"record": "v=DKIM1; k=rsa; p=MIIBIjAN…",
"keyType": "rsa",
"keyBits": 2048,
"revoked": false,
"issues": [
{
"level": "ok",
"key": "dkRsaOk",
"vars": {
"bits": 2048
}
}
]
}
],
"notFound": [],
"failed": []
},
"blocklists": null,
"queries": 7
}价格和限制
怎么收费
| 价格 | 每次 2 点 |
|---|---|
| 折合美元 | 约 $0.002 · $2 / 1,000 |
| 点数 | 免费或付费点数 |
| 限速 | 免费 10 次 / 分钟 · Plus 60 次 / 分钟 · Pro 300 次 / 分钟 |
| 免费账号每日上限 | 免费账号每把密钥每天 1,000 次 |
| 何时扣点 | 只有成功才扣,出错和超时不扣 |
用例
可以用来做什么
送达率排查
换服务商之前先找出邮件进垃圾箱的原因。
发信方接入
客户通过你的平台发信之前先检查他的域名。
持续监控
域名上了黑名单时提醒。
会发邮件吗?
不会。全部通过公开 DNS 和黑名单查询完成。
查哪些黑名单?
常用的公开 DNS 黑名单,结果会列出查过的每一个。
邮件认证检查 API 怎么收费?
每次成功调用扣 每次 2 点(约 $0.002),1 点约合 0.001 美元。调用失败——参数错误、目标网站打不开、超时或我们这边出错——都不扣。
可以免费试用吗?
可以。新账号送 300 点,每个账号每天再送 30 点,都能用在这个接口上。也可以不用密钥,直接在 tapcub.com 上用对应的免费工具试效果。
限速是多少?
免费账号每把密钥每分钟 10 次、每天 1,000 次;Plus 每分钟 60 次,Pro 每分钟 300 次。超出时返回 HTTP 429 并带 Retry-After 头,不扣点。
怎么拿到 API 密钥?
登录 TapCub 控制台,验证邮箱后在「工具套餐 → API」页新建密钥。密钥以 tck_ 开头,只显示一次;调用时放在 Authorization: Bearer 请求头里。