snipp-gg/snipp
snipp
Installation
requests.
Getting Started
Methods
get_user(user_id, include_posts=None, posts_limit=None)
Fetch a user by ID. Pass "@me" for the authenticated user.
| Parameter | Type | Description |
|---|---|---|
user_id | str | User ID or "@me". |
include_posts | bool | None | Include the user’s public uploads. |
posts_limit | int | None | Number of posts to return (1 to 50). |
get_post(code)
Fetch a post by its share code.
| Parameter | Type | Description |
|---|---|---|
code | str | The share code of the post. |
upload(file, privacy="unlisted", title=None, description=None, post_type=None)
Upload a file. Accepts a file path string, bytes, or a file-like object.
| Parameter | Type | Description |
|---|---|---|
file | str | bytes | BinaryIO | File path, raw bytes, or file object. |
privacy | str | "public", "unlisted", or "private". |
title | str | None | Optional post title (max 30 chars). |
description | str | None | Optional post description (max 200 chars). |
post_type | str | None | "album" (default) or "individual". Only applies when uploading two or more files. |
list_uploads(limit=None)
List the authenticated user’s recent uploads. Defaults to 30. Pass limit to control the count (max 1000).
| Argument | Type | Description |
|---|---|---|
limit | int | None | Maximum uploads to return (1-1000). |
edit_upload(code, title=None, description=None, privacy=None)
Edit an existing upload’s title, description, or privacy.
| Parameter | Type | Description |
|---|---|---|
code | str | The share code of the upload. |
title | str | None | New title (max 30 chars). Empty string to clear. |
description | str | None | New description (max 200 chars). Empty string to clear. |
privacy | str | None | "public", "unlisted", or "private". |
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 9 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.
| Parameter | Type | Description |
|---|---|---|
code | str | Share code of the post to append to. |
files | list[str | bytes | BinaryIO] | One or more files. Each item may be a file path, raw bytes, or a file-like object. |
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.
Error Handling
All API errors raise aSnippError with status and message attributes.

