API reference
ZeroHost API Documentation
One REST endpoint to create an expiring share, three ways to read it back. JSON in, JSON out.
- Base URL
https://api.zerohost.net- Auth
X-API-Key: zh_…- Format
application/json
Quick start
Create an API key on your account page (Pro plan), then send some text. The response gives you a link that deletes itself when it expires.
curl https://api.zerohost.net/v1/share \ -H "X-API-Key: $ZEROHOST_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text": "Hello from the API", "expires_in": "24h"}'
const res = await fetch("https://api.zerohost.net/v1/share", { method: "POST", headers: { "X-API-Key": process.env.ZEROHOST_API_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ text: "Hello from the API", expires_in: "24h" }) }); if (!res.ok) throw new Error((await res.json()).error); const { url } = await res.json();
import os, requests res = requests.post( "https://api.zerohost.net/v1/share", headers={"X-API-Key": os.environ["ZEROHOST_API_KEY"]}, json={"text": "Hello from the API", "expires_in": "24h"}, ) res.raise_for_status() print(res.json()["url"])
{
"id": "9b042e2b144afeb6421592fc7f5c0d94",
"url": "https://zerohost.net/share/9b042e2b144afeb6421592fc7f5c0d94",
"expires_at": "2026-11-22T09:42:00.000Z",
"expires_in": 86400,
"plan": "pro",
"usage": { "current": 1, "limit": -1 }
}
Prefer the terminal? The CLI wraps this same endpoint: echo "hi" | zerohost --expires 24h.
Authentication
Send your key in the X-API-Key header on every request that creates a share or checks usage. Keys start with zh_.
- Subscribe to Pro and sign in.
- On your account page, choose Generate API key.
- Copy it straight away. It is shown once; generating a new one replaces it.
Reading a share needs no key: anyone holding the link can read it, which is the point of a share link.
plan field in the response.
Plans and limits
| Pro key | No valid key | |
|---|---|---|
| Shares per day | Unlimited (5,000 API requests a day) | 10, per IP address |
| Longest expiry | 30 days | 24 hours |
| Password | Yes | Yes |
| Burn after reading | Yes | No (403) |
Daily counts reset at 00:00 UTC. Share creation responses carry these headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Shares allowed today. -1 means no daily cap. |
X-RateLimit-Remaining | Shares left today |
X-RateLimit-Reset | When the count resets, in Unix seconds |
Retry-After | On 429 only: seconds until you can try again |
GET/v1/usage
Today’s share count for your key. Checking does not count as a share.
curl https://api.zerohost.net/v1/usage -H "X-API-Key: $ZEROHOST_API_KEY"
{
"current": 42,
"limit": -1,
"plan": "pro",
"resetTime": 1795305600000
}
resetTime is in Unix milliseconds (next 00:00 UTC). limit is -1 when there is no daily cap.
Errors
Errors return JSON with an error string. Some add more fields, shown below.
| Status | When |
|---|---|
400 | Missing text, text over 1 MB, or an invalid reference |
401 | The share needs a password (requires_password: true), or the password is wrong |
403 | A Pro feature without a valid Pro key (error: "Upgrade required"), or content blocked by the acceptable use policy |
404 | The share doesn’t exist, has expired, or was already burned |
429 | The daily share limit is used up; see Retry-After |
500 | Something failed on our side; safe to retry |
{
"error": "Upgrade required",
"message": "Burn after reading requires a Pro subscription. …",
"feature": "burn_after_reading",
"current_plan": "free",
"upgrade_url": "https://zerohost.net/#pricing"
}
{
"error": "Rate limit exceeded",
"message": "You have exceeded the 10 shares per day limit for the free-ip plan.",
"current_usage": 10,
"limit": 10,
"reset_time": 1795305600000,
"upgrade_url": "https://zerohost.net/#pricing",
"plan": "free-ip"
}
{ "error": "Share not found or expired" }
feature is one of password_protection, burn_after_reading or extended_expiry.