ZeroPhantom API Docs
Simple REST APIs. Get started in minutes with any language.
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.
https://zerophantom.comGo to Converter API or TempMail API. Each call costs 1 credit.
Visit My Account → API Keys and generate a key.
Add X-API-Key: your_key to every request. That's it.
# 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); // 1000Authentication
All requests need an API key in the X-API-Key header. Keep it secret — use server-side code or env variables.
# Every request needs this header
X-API-Key: zp_live_xxxxxxxxxxxxxxxxxxxx
Credits
Every API call costs 1 credit. Credits never expire.
curl https://zerophantom.com/api/credits/balance \ -H "X-API-Key: YOUR_API_KEY"
Error Codes
Errors return JSON with an error field describing the issue.
Success. Response contains result.
Bad request. Check the error field.
Invalid or missing API key.
Not enough credits. Buy more →
Rate limited. Retry with backoff.
Server error. Retry after a few seconds.
Converter API
Convert files between 30+ formats. 1 credit per conversion. Supports PDF, images, documents, spreadsheets.
curl https://zerophantom.com/api/converter/formats \ -H "X-API-Key: YOUR_KEY"
Upload as multipart/form-data.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File | required | The file to convert |
| to | string | required | Target format: pdf, png, txt… |
| quality | integer | optional | Image quality 1–100 (default: 85) |
| dpi | integer | optional | DPI for PDF→image (default: 150) |
# 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| address | string | optional | Custom address or leave empty for random |
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 callscurl "https://zerophantom.com/api/tmpmail/messages?token=tok_xxx" \ -H "X-API-Key: YOUR_KEY"
curl "https://zerophantom.com/api/tmpmail/message/msg_abc?token=tok_xxx" \ -H "X-API-Key: YOUR_KEY"
curl -X POST https://zerophantom.com/api/tmpmail/delete \ -H "X-API-Key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"token": "tok_xxx"}'