Official SDKs
Official SDKs
TypeScript, Python, Go, and CLI clients for the TropMail API.
Four clients, one API. Each one unwraps the JSON envelope, retries 429 / 5xx, paces itself from rate-limit headers, and pages until a short page.
export TROPMAIL_API_KEY=your32charalphanumericapikeyhereBase URL: https://api.tropmail.com/api/v1
| Package | Install |
|---|---|
@tropmail/sdk | npm install @tropmail/sdk |
tropmail (Python) | pip install tropmail |
tropmail-go | go get github.com/tropmail/tropmail-go |
tropmail (CLI) | brew install tropmail/tap/tropmail |
TypeScript
import { TropMail } from "@tropmail/sdk";
const client = new TropMail({ apiKey: process.env.TROPMAIL_API_KEY });
const { mailboxes } = await client.mailboxes.list();
const mailboxId = mailboxes[0].id;
console.log(mailboxes[0].email);
for await (const email of client.emails.iterate({ mailboxId, status: "Open" })) {
console.log(email.timestamp, email.from.address, email.subject);
}Runs on Node 18+, Bun, Deno, and other fetch runtimes, including the browser. Details
Python
from tropmail import TropMail
with TropMail() as client:
boxes = client.mailboxes.list()
mailbox = boxes[0]
print(mailbox.email)
for email in client.emails.iterate(mailbox_id=mailbox.id, status="Open"):
print(email.timestamp, email.from_.address, email.subject)Sync and async. Python 3.10+. Details
Go
client, err := tropmail.New("") // reads TROPMAIL_API_KEY
listed, err := client.Mailboxes.List(ctx)
mailbox := listed.Mailboxes[0]
for email, err := range client.Emails.All(ctx, tropmail.ListOptions{MailboxID: mailbox.ID, Status: "Open"}) {
if err != nil {
return err
}
fmt.Println(email.Timestamp, email.From.Address, email.Subject)
}Standard library only. Go 1.23+. Details
CLI
tropmail auth login
tropmail mailboxes
tropmail ls --mailbox "$MAILBOX_ID" --status Open --json | jq -r '.emails[].subject'Shared behavior
- Validates the key format locally before the first request
- Returns typed
datafrom{ success, message, data, error } - Retries on
429/5xx, including markdown504 - Stays within your rate limit using
X-RateLimit-*headers - Auto-paging iterators that stop on a short page