プログラムから一時メールアドレスの作成・メール取得が可能です。
全エンドポイントは JSON を返します。
https://tempmail.jp
Authorization: Bearer tmj_xxx
password を含める
429 が返ります。
# Authorization ヘッダーで渡す(推奨) curl https://tempmail.jp/api/new-address \ -H "Authorization: Bearer tmj_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # Authorization ヘッダのみサポート(クエリパラメータは廃止) # キーなし(外部スクリプト)→ 401 { "success": false, "error": "API key required. Get one at https://tempmail.jp/dashboard.html" } # キーが無効 / 無効化済み → 401 { "success": false, "error": "Invalid or inactive API key" } # 月次上限超過 → 429 { "success": false, "error": "Monthly API limit exceeded" }
# Free プラン(デフォルト: @tempmail.jp) curl https://tempmail.jp/api/new-address \ -H "Authorization: Bearer tmj_xxxx" # Free プラン: @sutemeado.com を使用 curl "https://tempmail.jp/api/new-address?domain=sutemeado.com" \ -H "Authorization: Bearer tmj_xxxx" # Pro プラン専用ドメイン curl "https://tempmail.jp/api/new-address?domain=sutemail.com" \ -H "Authorization: Bearer tmj_xxxx" # レスポンス { "success": true, "address": "abc123@sutemeado.com", "password": "xyz789pass", "domain": "sutemeado.com" }
curl https://tempmail.jp/api/domains \ -H "Authorization: Bearer tmj_xxxx" # レスポンス { "success": true, "currentPlan": "pro", "domains": [ { "domain": "tempmail.jp", "accessible": true, "requiredPlan": null }, { "domain": "sutemeado.com", "accessible": true, "requiredPlan": null }, { "domain": "sutemail.com", "accessible": true, "requiredPlan": "pro" }, { "domain": "ai-debate.jp", "accessible": true, "requiredPlan": "pro" }, { "domain": "gdte.site", "accessible": true, "requiredPlan": "pro" } ] }
# リクエスト curl -X POST https://tempmail.jp/api/login \ -H "Content-Type: application/json" \ -d '{"address":"abc123@tempmail.jp","password":"xyz789pass"}' # レスポンス { "success": true, "address": "abc123@tempmail.jp", "mails": [...] }
curl -X PUT "https://tempmail.jp/api/address/abc123@tempmail.jp/password" \ -H "Content-Type: application/json" \ -d '{"currentPassword":"xyz789pass","newPassword":"newpass123"}'
curl -X DELETE "https://tempmail.jp/api/address/abc123@tempmail.jp" \ -H "Content-Type: application/json" \ -d '{"password":"xyz789pass"}'
curl -X POST "https://tempmail.jp/api/mailbox/abc123@tempmail.jp" \ -H "Content-Type: application/json" \ -d '{"password":"xyz789pass"}' # レスポンス { "success": true, "mails": [ { "id": "mail_xxx", "from": "sender@example.com", "subject": "確認コード", "body": "テキスト本文...", "receivedAt": 1711234567890, "saved": false } ] }
curl -X POST "https://tempmail.jp/api/mailbox/abc123@tempmail.jp/mail_xxx" \ -H "Content-Type: application/json" \ -d '{"password":"xyz789pass"}'
curl -X POST "https://tempmail.jp/api/mailbox/abc123@tempmail.jp/mail_xxx/save" \ -H "Content-Type: application/json" \ -d '{"password":"xyz789pass"}'
curl -X POST "https://tempmail.jp/api/mailbox/abc123@tempmail.jp/mail_xxx/unsave" \ -H "Content-Type: application/json" \ -d '{"password":"xyz789pass"}'
curl -X DELETE "https://tempmail.jp/api/mailbox/abc123@tempmail.jp/mail_xxx" \ -H "Content-Type: application/json" \ -d '{"password":"xyz789pass"}'
curl -X DELETE "https://tempmail.jp/api/mailbox/abc123@tempmail.jp" \ -H "Content-Type: application/json" \ -d '{"password":"xyz789pass"}'
curl "https://tempmail.jp/api/mailbox/abc123@tempmail.jp/otp?password=xyz789pass&limit=5" # レスポンス { "success": true, "found": true, "otp": "123456", "mailId": "mail_xxx", "subject": "確認コードのお知らせ", "receivedAt": 1711234567890 }
curl https://tempmail.jp/api/status
Content-Type: application/json ヘッダーとともに、リクエストボディに password フィールドを含めてください。OTP エンドポイントのみクエリパラメータで password を渡します。