Integration

Publish to snapy with Python

Turn content into a live link from a Python script or an AI agent in a few lines.

Publish to snapy with Python

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

Share your file in seconds

Drop a file, get a link. Free, no signup.

Upload a file