The short version
snapy's publish endpoint takes a JSON POST and returns a link. Here is all it takes in Python with the standard requests library.
import requests
r = requests.post("https://api.snapy.host/api/publish", json={
"content": "<!doctype html><h1>Hello from Python</h1>",
"name": "my-page", # optional
"filename": "index.html", # optional
})
data = r.json()
print(data["url"]) # https://my-page.snapy.page
Publishing a file from disk
import requests, base64
raw = open("report.pdf", "rb").read()
r = requests.post("https://api.snapy.host/api/publish", json={
"content_base64": base64.b64encode(raw).decode(),
"filename": "report.pdf",
})
print(r.json()["url"])
What you get back
The response includes url (the live link), stats_url (your private analytics page), and token. Open the link right away.
Good to know
- Up to 100MB per file, with fair-use rate limits.
- This is the same endpoint AI agents use. See the developer docs or the JavaScript guide.
