> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snipp.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get your API key and make your first upload in under five minutes.

## Get Started in Three Steps

Make your first API call and upload a file to Snipp.

### Step 1: Get Your API Key

1. Sign in to your account.
2. Open **Settings** and navigate to the API section.
3. Copy your API key. Include it in the `api-key` header with every request.

<Warning>
  Never share your API key or commit it to version control. Store it in an environment variable in production.
</Warning>

### Step 2: Verify Your Setup

Test your API key by fetching your own profile:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.snipp.gg/users/@me" \
    -H "api-key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  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);
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://api.snipp.gg/users/@me",
      headers={"api-key": "YOUR_API_KEY"},
  )
  print(res.json()["user"]["username"])
  ```
</CodeGroup>

A successful response returns your user object:

```json theme={null}
{
  "user": {
    "id": "123456789012345678",
    "username": "yourname",
    "plus": false,
    "verified": false,
    "badges": { ... },
    "uploads": 0
  }
}
```

### Step 3: Upload a File

Upload an image or video to your account:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.snipp.gg/upload" \
    -H "api-key: YOUR_API_KEY" \
    -H "post-privacy: unlisted" \
    -F "file=@/path/to/image.png"
  ```

  ```javascript JavaScript theme={null}
  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);
  ```

  ```python Python theme={null}
  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"])
  ```
</CodeGroup>

The response includes a direct URL to your file and a post object with share metadata:

```json theme={null}
{
  "message": "Upload successful!",
  "url": "https://i.snipp.gg/123456789012345678/abc123.png",
  "post": {
    "code": "AbCd1234",
    "url": "https://snipp.gg/p/AbCd1234",
    "postPrivacy": "unlisted"
  }
}
```

### Albums

Upload multiple files in one request to create an album. Add additional `-F "file=@..."` fields:

```bash theme={null}
curl -X POST "https://api.snipp.gg/upload" \
  -H "api-key: YOUR_API_KEY" \
  -H "post-title: My album" \
  -F "file=@photo1.png" \
  -F "file=@photo2.png"
```

Albums are the default when sending two or more files. To create separate posts instead, add `-H "post-type: individual"`.

### Privacy Options

Control who can see your uploads by setting the `post-privacy` header:

| Value      | Visibility                                                                                                                                                |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `private`  | Only you can view it (default). Response URLs are signed and expire after 24 hours. Re-fetch from `GET /posts/{code}` or `GET /uploads` for a fresh link. |
| `unlisted` | Anyone with the share link can view it.                                                                                                                   |
| `public`   | Visible to everyone and eligible for the Discover feed.                                                                                                   |

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Learn how the API key header works and security best practices.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Explore all available endpoints and response schemas.
  </Card>

  <Card title="File Types" icon="file" href="/concepts/file-types">
    See supported formats and size limits per plan.
  </Card>

  <Card title="Rate Limits" icon="gauge" href="/concepts/rate-limits">
    Understand request limits and how to handle throttling.
  </Card>
</CardGroup>
