ZeroPhantom API Docs

Simple REST APIs. Get started in minutes with any language.

Converter API TempMail API

Quick Start

ZeroPhantom APIs use a simple REST interface. Pass your API key in the X-API-Key header and you're ready to go.

Base URL https://zerophantom.com
Get your API key from the portalSign in → My Account → API Keys
Portal
1
Buy Credits

Go to Converter API or TempMail API. Each call costs 1 credit.

2
Get Your API Key

Visit My Account → API Keys and generate a key.

3
Make Your First Request

Add X-API-Key: your_key to every request. That's it.

curl
Python
JavaScript
# Check your credit balance
curl https://zerophantom.com/api/credits/balance \
  -H "X-API-Key: YOUR_API_KEY"
# → {"balance": 1000}
import requests
r = requests.get(
    "https://zerophantom.com/api/credits/balance",
    headers={"X-API-Key": "YOUR_API_KEY"}
)
print(r.json())  # {"balance": 1000}
const res = await fetch('https://zerophantom.com/api/credits/balance', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const { balance } = await res.json();
console.log(balance); // 1000

Authentication

All requests need an API key in the X-API-Key header. Keep it secret — use server-side code or env variables.

Never expose your API key in client-side JS or public repos.
# Every request needs this header
X-API-Key: zp_live_xxxxxxxxxxxxxxxxxxxx

Credits

Every API call costs 1 credit. Credits never expire.

GET /api/credits/balance Check balance
curl https://zerophantom.com/api/credits/balance \
  -H "X-API-Key: YOUR_API_KEY"
{"balance": 1000}

Error Codes

Errors return JSON with an error field describing the issue.

200

Success. Response contains result.

400

Bad request. Check the error field.

401

Invalid or missing API key.

402

Not enough credits. Buy more →

429

Rate limited. Retry with backoff.

500

Server error. Retry after a few seconds.

Converter API

Convert files between 30+ formats. 1 credit per conversion. Supports PDF, images, documents, spreadsheets.

GET /api/converter/formats List all formats — free
curl https://zerophantom.com/api/converter/formats \
  -H "X-API-Key: YOUR_KEY"
{"map": {"pdf": ["txt","png","docx",...], "docx": ["pdf","txt","odt",...]}}
POST /api/convert Convert file — 1 credit

Upload as multipart/form-data.

ParameterTypeRequiredDescription
fileFilerequiredThe file to convert
tostringrequiredTarget format: pdf, png, txt
qualityintegeroptionalImage quality 1–100 (default: 85)
dpiintegeroptionalDPI for PDF→image (default: 150)
curl
Python
JavaScript
PHP
# DOCX → PDF
curl -X POST https://zerophantom.com/api/convert \
  -H "X-API-Key: YOUR_KEY" \
  -F "file=@report.docx" \
  -F "to=pdf" \
  -o output.pdf
import requests
with open("report.docx", "rb") as f:
    r = requests.post(
        "https://zerophantom.com/api/convert",
        headers={"X-API-Key": "YOUR_KEY"},
        files={"file": f},
        data={"to": "pdf"}
    )
with open("output.pdf", "wb") as out:
    out.write(r.content)
const form = new FormData();
form.append('file', fileInput.files[0]);
form.append('to', 'pdf');
const res = await fetch('/api/convert', {
  method: 'POST',
  headers: { 'X-API-Key': 'YOUR_KEY' },
  body: form
});
const blob = await res.blob();
// Save blob as file
$ch = curl_init('https://zerophantom.com/api/convert');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ["X-API-Key: YOUR_KEY"],
  CURLOPT_POSTFIELDS => [
    'file' => new CURLFile('report.docx'),
    'to' => 'pdf'
  ],
  CURLOPT_RETURNTRANSFER => true,
]);
file_put_contents('output.pdf', curl_exec($ch));

Response headers: X-Credits-Used (always 1) · X-Credits-Remaining

TempMail API

Create disposable inboxes programmatically. Each inbox lives 24 hours. 1 credit per call.

POST /api/tmpmail/create Create inbox — 1 credit
ParameterTypeRequiredDescription
addressstringoptionalCustom address or leave empty for random
curl
Python
curl -X POST https://zerophantom.com/api/tmpmail/create \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
import requests
r = requests.post("https://zerophantom.com/api/tmpmail/create",
    headers={"X-API-Key": "YOUR_KEY"}, json={})
inbox = r.json()
print(inbox["address"])  # abc@zerophantom.com
print(inbox["token"])    # use for all other calls
{"address": "abc123@zerophantom.com", "token": "tok_xxx", "expires_at": "2025-03-02T12:00:00Z"}
GET/api/tmpmail/messagesList messages — 1 credit
curl "https://zerophantom.com/api/tmpmail/messages?token=tok_xxx" \
  -H "X-API-Key: YOUR_KEY"
{"messages": [{"id": "msg_abc", "from": "sender@x.com", "subject": "Your code", "received_at": "..."}], "count": 1}
GET/api/tmpmail/message/{id}Read message — 1 credit
curl "https://zerophantom.com/api/tmpmail/message/msg_abc?token=tok_xxx" \
  -H "X-API-Key: YOUR_KEY"
{"id": "msg_abc", "subject": "Your code", "body_text": "Code: 123456", "body_html": "<p>...</p>"}
POST/api/tmpmail/deleteDelete inbox — free
curl -X POST https://zerophantom.com/api/tmpmail/delete \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"token": "tok_xxx"}'
{"success": true}
Support We reply fast
ZeroPhantom Support