snipp-gg/snipp-py
snipp
Installation
requests.
Getting Started
Regional endpoints
Passregion to pin the client to a specific regional host. Uploads run at the same speed either way; this controls which region stores your files.
Methods
get_user(user_id, include_posts=None, posts_limit=None)
Fetch a user by ID. Pass "@me" for the authenticated user.
get_post(code)
Fetch a post by its share code. Team posts are only readable by members of that team, and omit likeCount.
upload(file, privacy=None, title=None, description=None, post_type=None)
Upload a file. Accepts a file path string, bytes, or a file-like object.
list_uploads(limit=None)
List the authenticated user’s recent uploads. Defaults to 30. Pass limit to control the count (max 1000).
edit_upload(code, title=None, description=None, privacy=None)
Edit an existing upload’s title, description, or privacy.
append_upload(code, files)
Add one or more files to an existing album post. The post’s share code, privacy, title, and description are preserved. Albums cap at 50 files total. Requests that would exceed the cap are rejected. New files inherit the post’s privacy. Returned URLs are signed with a 24-hour expiry for private posts.
delete_upload(filename)
Delete an upload by its filename. On albums, only that file is removed; on single-file posts the entire post is deleted.
report_post(code, reason="")
Report a post, with an optional reason (max 200 chars).
Error Handling
All API errors raise aSnippError 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.