通过 REST API 创建和管理测试邮箱。OTP 代码自动解析为 JSON,支持 Webhook 推送。与 Playwright、Cypress、Selenium 无缝集成。
const inbox = await gridinbox.create();
// Email: [email protected]
await page.type('#email', inbox.email);
await page.click('#send-code');
// Auto-extracted OTP via API or Webhook
const otp = await inbox.waitForOtp({
timeout: 30000
});
await page.type('#otp', otp.code);
console.log('✅ Verified!');
自动化邮件测试的典型痛点。
免费临时邮箱在生产环境中随时会被平台识别并拒绝,导致测试流程频繁中断,CI/CD 流水线不稳定。
每次测试都要人工登录邮箱、找到验证码、再手动输入——自动化流水线里插入手动步骤,根本谈不上"自动化"。
并发运行 50 个测试实例时,传统邮箱服务商直接封号或限速,自动化规模根本跑不起来。
从注册到跑通第一个 Playwright 测试,15 分钟以内。
创建账号后立即获取 REST API 密钥。支持 Bearer Token 认证,3 分钟完成集成配置。
通过一行 API 调用创建独立测试邮箱,邮件地址即时生成,持久存储,不会过期。
注册 Webhook 端点,邮件到达时立即推送解析后的 OTP JSON;或使用 waitForOtp() 方法轮询等待。
使用 GET /messages 轮询,或注册 Webhook URL 在邮件到达时即时触发。两种模式均返回清洁的 JSON。
HTML 邮件在服务端自动解析,你拿到的是 {"code": "382917", "expires_in": 540},无需自己写正则。
读取操作无速率限制。100 个并发测试实例同时运行,API 稳定响应,不封号不限速。
不同于临时邮箱,GridInbox 测试邮箱持久有效。可复用于回归测试,历史邮件保留可查。
{
"inbox": "[email protected]",
"received_at": "2026-04-02T03:12:44Z",
"from": "[email protected]",
"subject": "Your verification code",
"otp": {
"code": "382917",
"expires_in": 540
}
}
标准 HTTPS + Bearer Token 认证,无需 SDK,任何语言均可调用。
export KEY=sk_live_your_api_key
export ALIAS=[email protected]
export SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -s \
"https://api.gridinbox.com/api/v1/messages/latest-otp?alias=${ALIAS}&timeout=30&since=${SINCE}" \
-H "Authorization: Bearer ${KEY}"
# Response:
{
"success": true,
"data": {
"messageId": "018f3a2b-...",
"subject": "Your verification code",
"otpCode": "483920",
"receivedAt": "2026-06-13T08:12:01Z",
"from": "[email protected]"
}
}
在 CI/CD 流水线中自动测试邮件注册、验证码输入、账号激活全流程。支持 Playwright/Cypress/Selenium。
为 LangChain、AutoGPT 等 AI Agent 提供真实的邮箱用于平台注册和验证,全程无人工干预。
向多个来源订阅行业通讯和价格报告,程序化抓取邮件内容用于市场分析和竞品监控。
为生产系统设置告警邮箱,通过 Webhook 实时触发监控流程,确保关键邮件通知零延迟响应。
Create a test inbox via the GridInbox REST API, trigger the OTP email in your test, then poll the GridInbox API for the latest email and extracted OTP. This gives you a real, isolated inbox per test run with no shared mailbox race conditions.
Yes. GridInbox's REST API supports full lifecycle management: create a fresh alias for each test case, run the test, then delete or reuse the alias. Ideal for CI/CD pipelines that need isolated, disposable email inboxes on demand.
GridInbox processes inbound emails in real time. Once delivered, OTP extraction typically completes within seconds. A polling interval of 2-3 seconds over a 30-second window reliably captures the code for most platforms.
Yes. GridInbox's API uses standard HTTPS, so it works in any CI/CD environment — GitHub Actions, GitLab CI, CircleCI, Jenkins, or Docker pipelines. Store your API key as a CI secret and call the API from your test scripts.
"我们需要同时跑 200 个并发注册测试。以前用各种临时邮箱工具,总在第 20 个账号时被封。GridInbox API 跑满了 200 个,完全没问题。"
"把 GridInbox 接入 Playwright 只花了 15 分钟。waitForOtp() 这个方法直接省掉了我们自己写的所有轮询逻辑,CI 里的邮件验证终于稳定了。"