| title | Quickstart |
|---|---|
| description | Get your API key and make your first upload in under five minutes |
Make your first API call and upload a file to Snipp.
- Sign in at snipp.gg.
- Open Settings and navigate to the API section.
- Copy your API key. You'll include it in the
api-keyheader with every request.
Test your API key by fetching your own profile:
```bash cURL curl -X GET "https://api.snipp.gg/users/@me" \ -H "api-key: YOUR_API_KEY" ```const res = await fetch("https://api.snipp.gg/users/@me", {
headers: { "api-key": "YOUR_API_KEY" },
});
const data = await res.json();
console.log(data.user.username);import requests
res = requests.get(
"https://api.snipp.gg/users/@me",
headers={"api-key": "YOUR_API_KEY"},
)
print(res.json()["user"]["username"])A successful response returns your user object:
{
"user": {
"id": "123456789012345678",
"username": "yourname",
"plus": false,
"verified": false,
"badges": { ... },
"uploads": 0
}
}Upload an image or video to your account:
```bash cURL curl -X POST "https://api.snipp.gg/upload" \ -H "api-key: YOUR_API_KEY" \ -H "post-privacy: unlisted" \ -F "file=@/path/to/image.png" ```const formData = new FormData();
formData.append("file", fileInput.files[0]);
const res = await fetch("https://api.snipp.gg/upload", {
method: "POST",
headers: {
"api-key": "YOUR_API_KEY",
"post-privacy": "unlisted",
},
body: formData,
});
const data = await res.json();
console.log(data.url);import requests
with open("image.png", "rb") as f:
res = requests.post(
"https://api.snipp.gg/upload",
headers={
"api-key": "YOUR_API_KEY",
"post-privacy": "unlisted",
},
files={"file": f},
)
print(res.json()["url"])The response includes a direct URL to your file and a post object with share metadata:
{
"message": "Upload successful!",
"url": "https://i.snipp.gg/123456789012345678/abc123.png",
"post": {
"code": "AbCd1234",
"url": "https://snipp.gg/share/AbCd1234",
"postPrivacy": "unlisted"
}
}Upload multiple files in one request to create an album. Just add more -F "file=@..." fields:
curl -X POST "https://api.snipp.gg/upload" \
-H "api-key: YOUR_API_KEY" \
-H "posttitle: My album" \
-F "file=@photo1.png" \
-F "file=@photo2.png"Albums are the default when sending 2+ files. To create separate posts instead, add -H "post-type: individual".
Control who can see your uploads by setting the post-privacy header:
| Value | Visibility |
|---|---|
private |
Only you can view it |
unlisted |
Anyone with the share link can view it (default) |
public |
Visible to everyone and eligible for the Discover feed |