snipp
A Python wrapper for the Snipp API.
Features
- Upload files from paths, bytes, or file objects
- Upload, edit, append, and delete files and album posts
- Simple error handling with
SnippError
Requirements
- Python 3.9 or higher
- A valid API key from the Snipp Console
Dependencies (automatically installed):
requests
Installation
pip install snipp
Or install from source:
pip install .
Quick Start
from snipp import SnippClient
client = SnippClient(api_key="YOUR_API_KEY")
# Get your own profile
me = client.get_user()
# Upload a file
result = client.upload("screenshot.png", privacy="unlisted")
# List your uploads
uploads = client.list_uploads()
# Delete an upload
client.delete_upload("a3f7b2c91d4e8f0612ab34cd56ef7890.png")
API
SnippClient(api_key, region=None)
Create a client. The key is sent via the api-key header on every request.
| Argument | Type | Description |
|---|---|---|
api_key |
str |
Your Snipp API key. |
region |
str |
Optional. Pin requests to a regional endpoint, "eu-west-1" or "us-west-1". Uploads run at the same speed either way; this controls which region stores your files. Omit to use api.snipp.gg. |
client = SnippClient(api_key="YOUR_API_KEY", region="eu-west-1")
get_user(user_id="@me", include_posts=None, posts_limit=None)
Fetch a user profile. Pass "@me" (default) for the authenticated user. Set include_posts=True and posts_limit (1-50) to include their posts.
user = client.get_user("@me", include_posts=True, posts_limit=10)
get_post(code)
Get a post by its share code. Team posts are only readable by members of that team, and omit like_count.
post = client.get_post("AbC123")["post"]
upload(file, privacy=None, title=None, description=None, post_type=None)
Upload a file. file can be a path string, raw bytes, or an open file object. privacy must be "public", "unlisted", or "private"; it defaults to private when omitted. title caps at 30 chars, description at 200. post_type ("album" or "individual") is sent as the post-type header and has no effect through upload(), which sends a single file; use append_upload to build an album.
result = client.upload("image.png", privacy="unlisted")
print(result["url"])
list_uploads(limit=None)
List the authenticated user's recent uploads (limit 1-1000). Each item includes the upload URL, size metadata, the associated post code when one exists, and is_album for uploads that belong to an album post.
uploads = client.list_uploads(limit=100)
edit_upload(code, title=None, description=None, privacy=None)
Edit an existing upload's title, description, or privacy. Empty strings clear the title or description.
client.edit_upload("AbC123", title="New title", privacy="public")
append_upload(code, files)
Append 1 or more files to an existing album post. Albums cap at 50 files total.
client.append_upload("AbC123", ["extra.png"])
delete_upload(filename)
Delete an upload by its filename.
client.delete_upload("a3f7b2c91d4e8f0612ab34cd56ef7890.png")
report_post(code, reason="")
Report a post, with an optional reason (max 200 chars).
client.report_post("AbC123", "Spam")
Error Handling
All API errors raise a SnippError with status, message, and body attributes. body is the parsed JSON error response, or None when the response was not JSON. It carries the fields the API sends alongside error, such as suspended on a suspended user or moderated on a moderated post.
from snipp import SnippClient, SnippError
try:
client.get_user("987654321098765432")
except SnippError as err:
if err.body and err.body.get("suspended"):
print(f"{err.body['username']} is suspended")
else:
print(err.status, err.message)
Contributing
We welcome suggestions and improvements:
- Open an issue
- Submit a pull request that adheres to our Terms of Service and Privacy Policy
License
MIT License © 2026 Snipp. See LICENSE for full details.
Metadata
Release files for snipp 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snipp-2.0.0.tar.gz | 7.0 kB | Without provenance | Details for snipp-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| snipp-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for snipp-2.0.0-py3-none-any.whl |
Total release size: 14.6 kB
Release files / snipp-2.0.0.tar.gz
| Download URL | snipp-2.0.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d06f0106e67f21aae8ecf61e7fbaee1c25e3e3a0dc7e1ec7c789d6c942e27d9
|
|
BLAKE2b-256 checksum How to use checksums |
09f0c5d0aea2486e391b3c5231d1e99a60c625534bce26acda1cc757a7ee8fdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / snipp-2.0.0-py3-none-any.whl
| Download URL | snipp-2.0.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75a03a57239473ea6015d23527b897a61b7859cd4c2f96f117f23d2e398353f8
|
|
BLAKE2b-256 checksum How to use checksums |
7cd28200f2b16ab75ce53d673eb8254a3747dc58854bde13d8f1864cddc48540
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for snipp 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.