ZeroPhantom API
File Converter & OCR: 1 credit/call. Temp Mail API: Free. All on one credit wallet. Credits never expire.
Quick Start
Three steps to your first API call:
# Convert a PDF to plain text — 1 credit curl -X POST https://zphantom.com/api/convert \ -H "X-API-Key: zpk_your_key_here" \ -F "file=@document.pdf" \ -F "to=txt" \ -o result.txt
import requests
r = requests.post(
"https://zphantom.com/api/convert",
headers={"X-API-Key": "zpk_your_key_here"},
files={"file": open("document.pdf", "rb")},
data={"to": "txt"},
)
with open("result.txt", "wb") as f:
f.write(r.content)
print("Credits left:", r.headers.get("X-Credits-Remaining"))const form = new FormData();
form.append("file", fileInput.files[0]);
form.append("to", "txt");
const res = await fetch("https://zphantom.com/api/convert", {
method: "POST",
headers: { "X-API-Key": "zpk_your_key_here" },
body: form,
});
const blob = await res.blob();
const url = URL.createObjectURL(blob);
// Trigger download
const a = document.createElement("a");
a.href = url; a.download = "result.txt"; a.click();$ch = curl_init("https://zphantom.com/api/convert");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["X-API-Key: zpk_your_key_here"],
CURLOPT_POSTFIELDS => [
"file" => new CURLFile("document.pdf"),
"to" => "txt",
],
CURLOPT_RETURNTRANSFER => true,
]);
file_put_contents("result.txt", curl_exec($ch));
curl_close($ch);Authentication
Pass your API key in the X-API-Key header on every request. Keys start with zpk_.
X-API-Key: zpk_xxxxxxxxxxxxxxxxxxxx
Pricing — Why We're Cheapest
File Converter & OCR: 1 credit/call ($0.0020). TempMail API: Free. Credits never expire. Compare:
| Service | Price per conversion | $5 buys you | Notes |
|---|---|---|---|
| 🟢 ZeroPhantom Converter | $0.0020 / call | 2,500 calls | 200+ formats. Credits never expire. |
| Zamzar | $0.05 / call | 100 calls25× more expensive | $25/month plan |
| CloudConvert | $0.016–$0.08 / call | 62–312 calls8–40× more expensive | Per-minute packages |
| ConvertAPI | $0.003–$0.01 / call | 500–1666 calls2–5× more expensive | Monthly subscription |
| 🟢 ZeroPhantom TempMail | FREE | Unlimited | No credits. API key required. |
| Mailslurp | $0.01+ / inbox | 500 inboxesPaid | Per-inbox pricing |
| mail.tm | Free (public) | 8 req/s sharedNo commercial use | No SLA, TOS restricts resale |
Credits API
curl https://zphantom.com/api/credits/balance \ -H "X-API-Key: zpk_your_key"
Error Codes
| HTTP | code | Meaning |
|---|---|---|
| 400 | INVALID_FORMAT | Unsupported conversion pair or bad parameters |
| 401 | INVALID_API_KEY | Key missing, revoked, or malformed |
| 402 | INSUFFICIENT_CREDITS | Balance too low — top up here → |
| 413 | FILE_TOO_LARGE | File exceeds 50 MB limit |
| 429 | RATE_LIMITED | Too many requests — see rate limits below |
| 500 | CONVERSION_FAILED | Server-side error — no credit charged |
Rate Limits
X-RateLimit-Remaining and Retry-After (on 429).File Converter API
Convert between 75+ formats — images, PDFs, documents, spreadsheets, data, and code. 1 credit per conversion. Always free at /converter in the browser.
curl https://zphantom.com/api/converter/formats \ -H "X-API-Key: zpk_your_key"
Upload as multipart/form-data. Response is the converted file (binary).
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File | required | The file to convert. Max 50 MB. |
| conversion_type | string | required | Target format or full key: pdf, png, txt, docx — or full key like docx_to_pdf |
| quality | integer | optional | Image quality 1–100 (default: 85) |
| dpi | integer | optional | DPI for PDF→image rendering (default: 150) |
| format | string | optional | Pass url to get a JSON response with a download_url instead of raw bytes. Ideal for scripts & automation. Default: raw file. |
# DOCX → PDF (raw bytes — saves directly) curl -X POST https://zphantom.com/api/convert \ -H "X-API-Key: zpk_your_key" \ -F "file=@report.docx" \ -F "conversion_type=pdf" \ -o output.pdf # PNG → WebP at quality 90 curl -X POST https://zphantom.com/api/convert \ -H "X-API-Key: zpk_your_key" \ -F "file=@photo.png" \ -F "conversion_type=webp" \ -F "quality=90" \ -o photo.webp # Get JSON with download_url instead of raw bytes (?format=url) curl -X POST "https://zphantom.com/api/convert?format=url" \ -H "X-API-Key: zpk_your_key" \ -F "file=@report.docx" \ -F "conversion_type=pdf" # → {"success":true,"download_url":"/api/download/report_123_converted.pdf"}
import requests, pathlib
def convert(path: str, to: str, **kwargs) -> bytes:
with open(path, "rb") as f:
r = requests.post(
"https://zphantom.com/api/convert",
headers={"X-API-Key": "zpk_your_key"},
files={"file": (pathlib.Path(path).name, f)},
data={"conversion_type": to, **kwargs},
)
r.raise_for_status()
print("Credits left:", r.headers.get("X-Credits-Remaining"))
return r.content
# Examples
pdf_bytes = convert("report.docx", "pdf")
webp_bytes = convert("photo.png", "webp", quality=90)
txt_bytes = convert("scan.pdf", "txt") # OCRasync function convertFile(file, toFormat) {
const form = new FormData();
form.append("file", file);
form.append("conversion_type", toFormat);
const res = await fetch("https://zphantom.com/api/convert", {
method: "POST",
headers: { "X-API-Key": "zpk_your_key" },
body: form,
});
if (!res.ok) {
const err = await res.json();
throw new Error(err.message || "Conversion failed");
}
console.log("Credits left:", res.headers.get("X-Credits-Remaining"));
return res.blob(); // save or display as needed
}<?php
function convert(string $path, string $to): string {
$ch = curl_init("https://zphantom.com/api/convert");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["X-API-Key: zpk_your_key"],
CURLOPT_POSTFIELDS => [
"file" => new CURLFile($path),
"conversion_type" => $to,
],
CURLOPT_RETURNTRANSFER => true,
]);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
file_put_contents("output.pdf", convert("report.docx", "pdf"));Response headers: X-Credits-Used: 1 · X-Credits-Remaining: N · Content-Type: application/octet-stream
Quick Inbox Recommended
Create a disposable inbox in a single request — no address or password needed. Use the returned token as Authorization: Bearer TOKEN on all subsequent calls.
| Parameter | Type | Required | Description |
|---|---|---|---|
| domain | string | optional | Preferred domain (defaults to first available) |
| prefix | string | optional | Username prefix, e.g. test → testabc123@... |
curl -X POST https://zphantom.com/api/tempmail/inbox \ -H "X-API-Key: zpk_your_key"
import requests
r = requests.post(
"https://zphantom.com/api/tempmail/inbox",
headers={"X-API-Key": "zpk_your_key"},
)
data = r.json()
address = data["address"] # abc123@mail.zphantom.com
token = data["token"] # use as Bearer token going forwardconst r = await fetch("https://zphantom.com/api/tempmail/inbox", {
method: "POST",
headers: { "X-API-Key": "zpk_your_key" },
});
const { address, token } = await r.json();
// Use token as: Authorization: Bearer <token>Temp Mail API
Programmatic disposable email inboxes. Free with API key. Always free at /tempmail in the browser.
POST /api/tempmail/inbox — one call, get address + token instantly. Or use the manual 2-step flow: create account → get token → use Authorization: Bearer TOKEN on all inbox calls.| Parameter | Type | Required | Description |
|---|---|---|---|
| address | string | required | Full email address e.g. test123@yourdomain.com |
| password | string | required | Password for this mailbox (min 8 chars) |
curl -X POST https://zphantom.com/api/tempmail/accounts \ -H "X-API-Key: zpk_your_key" \ -H "Content-Type: application/json" \ -d '{"address": "test123@mail.zphantom.com", "password": "MyPass123!"}'
import requests
r = requests.post(
"https://zphantom.com/api/tempmail/accounts",
headers={"X-API-Key": "zpk_your_key"},
json={"address": "test123@mail.zphantom.com", "password": "MyPass123!"},
)
print(r.status_code) # 201 = createdconst r = await fetch("https://zphantom.com/api/tempmail/accounts", {
method: "POST",
headers: { "X-API-Key": "zpk_your_key", "Content-Type": "application/json" },
body: JSON.stringify({ address: "test123@mail.zphantom.com", password: "MyPass123!" }),
});
// 201 = created| Parameter | Type | Required | Description |
|---|---|---|---|
| address | string | required | The email address you created |
| password | string | required | The password you set |
curl -X POST https://zphantom.com/api/tempmail/token \ -H "X-API-Key: zpk_your_key" \ -H "Content-Type: application/json" \ -d '{"address": "test123@mail.zphantom.com", "password": "MyPass123!"}'
curl https://zphantom.com/api/tempmail/messages \ -H "Authorization: Bearer tok_xxx" \ -H "X-API-Key: zpk_your_key"
Get the newest message with full body and auto-detected OTP/code — no need to list messages first. Optionally pass ?wait=N (0–30 seconds) to poll until a new message arrives.
| Parameter | Type | Required | Description |
|---|---|---|---|
| wait | integer | optional | Seconds to poll if inbox empty (0–30, default 0). Set to 10–20 when waiting for OTP emails. |
# Wait up to 20s for an OTP email to arrive curl "https://zphantom.com/api/tempmail/messages/latest?wait=20" \ -H "Authorization: Bearer tok_xxx" \ -H "X-API-Key: zpk_your_key"
import requests
r = requests.get(
"https://zphantom.com/api/tempmail/messages/latest",
headers={
"Authorization": "Bearer tok_xxx",
"X-API-Key": "zpk_your_key",
},
params={"wait": 20}, # poll up to 20s for a new email
)
msg = r.json()
if msg["found"]:
print("OTP:", msg["otp"]) # e.g. "847291"
print("Text:", msg["text"]) # full plain-text body
else:
print("No messages yet")const r = await fetch(
"https://zphantom.com/api/tempmail/messages/latest?wait=20",
{ headers: { "Authorization": "Bearer tok_xxx", "X-API-Key": "zpk_your_key" } }
);
const msg = await r.json();
if (msg.found) {
console.log("OTP:", msg.otp); // "847291"
console.log("Body:", msg.text);
}curl https://zphantom.com/api/tempmail/messages/msg_abc123 \ -H "Authorization: Bearer tok_xxx" \ -H "X-API-Key: zpk_your_key"
Uses your Bearer token for auth. The {id} in the path can be any value — account is identified by your token.
curl -X DELETE https://zphantom.com/api/tempmail/accounts/me \ -H "Authorization: Bearer tok_xxx" \ -H "X-API-Key: zpk_your_key"
OCR API
Extract text from images and PDFs. 1 credit per call. Supports JPG, PNG, TIFF, BMP, PDF. Always free at /ocr in the browser.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File | required | Image or PDF to extract text from |
| lang | string | optional | Language code (default: eng). E.g. ara, fra, deu |
curl -X POST https://zphantom.com/api/ocr \ -H "X-API-Key: zpk_your_key" \ -F "file=@invoice.png" \ -F "lang=eng"
import requests
r = requests.post(
"https://zphantom.com/api/ocr",
headers={"X-API-Key": "zpk_your_key"},
files={"file": open("invoice.png", "rb")},
data={"lang": "eng"},
)
data = r.json()
print(data["text"]) # extracted text