公共 API:访问通用邮件数据
像 getMail 或 getDomains 这样的端点有两种模式:
X-API-KEY 标头。这将根据您的订阅计划为您提供即时响应 和更高的限制。X-API-KEY: your_subscription_api_key_hereBearer 令牌(用于私有端点)
仅对私有端点 Authorization: Bearer <token> 使用 仅 请求头 /private/emails。在您的仪表板中生成此令牌。它将您作为特定用户进行身份验证,以通过 API 访问您的个人邮件。
Authorization: Bearer your_generated_dashboard_token_here如何获取 API 密钥
API 密钥对所有用户可用。注意:只有当 API 密钥链接到活跃的付费订阅计划时,才会授予即时/无延迟访问权限 - 否则请求将被视为公共请求(受标准速度和免费层级速率限制)。
登录您的帐户
使用您的电子邮件和密码登录您的 CyberTemp 帐户。
访问设置
单击右上角的个人资料头像,然后从下拉菜单中选择“设置”。
生成 API 密钥
向下滚动到“API 密钥”部分,然后单击“生成新密钥”按钮。复制并安全地存储您的 API 密钥。
X-API-KEY = 免费(非优先队列)。使用活跃付费订阅 = 优先(即时)。/private/emails): 使用 Authorization: Bearer <token> (必需)。需要即时 API 访问?订阅计划:
查看订阅套餐我们的 API 需要 API 密钥才能进行所有访问。免费层级对每个请求都有标准处理速度,并适用速率限制。订阅用户获得具有更高限制的即时访问:
免费层级
需要 API 密钥
Eco 计划
€1.99/月
Core 计划
€2.99/月
Elite 计划
€4.99/月
Team
€49/月 · 5 个席位 · 每个席位均享 Elite 功能
// Public endpoint: Use X-API-KEY
async function getEmails(email, apiKey = null, limit = 25, offset = 0) {
const headers = apiKey ? { 'X-API-KEY': apiKey } : {};
const params = new URLSearchParams({ email });
if (limit !== 25) params.append('limit', limit.toString());
if (offset > 0) params.append('offset', offset.toString());
const url = `https://api.cybertemp.xyz/getMail?${params}`;
const response = await fetch(url, { headers });
if (!response.ok) { const err = await response.text(); throw new Error('HTTP error! ' + response.status + ': ' + err); }
return response.json();
}更喜欢使用客户端库?跳转到 客户端库
message.received新邮件到达您的某个收件箱。inbox.created您的账户上配置了新收件箱。test.ping从仪表板的「测试」按钮触发 — 在真实邮件到达之前验证您的端点很有用。{
"event": "message.received",
"delivery_id": "7c4f...",
"timestamp": 1731234567,
"data": {
"inbox_id": "5d2f...",
"inbox": "[email protected]",
"message_id": "9a1b...",
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Your verification code",
"received_at": "2026-05-17T09:31:00Z",
"size_bytes": 4732,
"encrypted": true
}
}使用您的签名密钥对原始请求正文进行 HMAC,并使用恒定时间比较与 X-Cybertemp-Signature 标头进行比较。
import crypto from "node:crypto";
import express from "express";
const app = express();
app.use("/webhooks/cybertemp",
express.raw({ type: "application/json" }));
app.post("/webhooks/cybertemp", (req, res) => {
const header = req.header("x-cybertemp-signature") || "";
const expected = "sha256=" + crypto
.createHmac("sha256", process.env.CT_WEBHOOK_SECRET)
.update(req.body)
.digest("hex");
if (!crypto.timingSafeEqual(
Buffer.from(header), Buffer.from(expected)
)) return res.status(401).end();
const event = JSON.parse(req.body.toString("utf8"));
// ...handle event...
res.status(200).end();
});在 5xx 或超时时,我们使用指数退避 (1分钟、5分钟、30分钟、6小时) 重试。连续失败 10 次后,我们将自动暂停 webhook 并在仪表板中显示横幅。2xx 视为成功并重置失败计数器。
管理您的 webhook 端点和签名密钥
打开设置 → Webhookspip install cybertempfrom cybertemp import CyberTemp
client = CyberTemp(api_key="tk_...")
emails = client.get_email_content("[email protected]")
domains = client.get_domains()go get github.com/sexfrance/cybertemp-goimport cybertemp "github.com/sexfrance/cybertemp-go"
c := cybertemp.New("tk_...")
inbox, _ := c.CreateInbox(ctx, nil)
msg, _ := c.WaitForMessage(ctx, inbox.ID, 60*time.Second, nil)cargo add cybertemp tokio --features tokio/fulluse cybertemp::Client;
use std::time::Duration;
let client = Client::new("tk_...");
let inbox = client.create_inbox().await?;
let msg = client.wait_for_message(&inbox.id, Duration::from_secs(60)).await?;无需安装包:Node 18+ 已内置 fetch。
const res = await fetch(
"https://api.cybertemp.xyz/[email protected]",
{ headers: { "X-API-KEY": process.env.CYBERTEMP_API_KEY! } },
);
const emails = await res.json(); // [{ id, from, subject, text, html, date }]一站式邮件 API!这个单一端点可以满足您的所有需求:
getEmails 如何工作:
认证:
GET /[email protected]&limit=50&offset=100
X-API-KEY: your_api_key_here[
{
"id": "email:xyz",
"from": "[email protected]",
"to": "[email protected]",
"subject": "Test Email",
"text": "Email content",
"html": "<p>Email content</p>",
"date": "2024-01-01T00:00:00.000Z"
}
]