# Pixeldrain API

> Returns public Pixeldrain file details with download link, plus view, download and bandwidth statistics of a file.

Category: Utilities. Region: global. 2 endpoints at `https://api.hoshime.com/v1/pixeldrain/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/pixeldrain
## GET /v1/pixeldrain/file

A public Pixeldrain file by its id or viewer URL: name, size, checksum, availability and the direct download link.

Scope: `social:read` · Units: 1 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Pixeldrain viewer URL (https://pixeldrain.com/u/<id>) or the file id. (e.g. 5UZcgpfV) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `availability` (string), `canDownload` (boolean), `downloadUrl` (string), `downloads` (integer (int64)), `id` (string), `mimeType` (string), `name` (string), `sha256` (string), `size` (integer (int64)), `thumbnailUrl` (string), `uploadedAt` (string), `viewerUrl` (string), `views` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/pixeldrain/file?url=5UZcgpfV" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/pixeldrain/stats

Views, downloads and bandwidth of one public Pixeldrain file.

Scope: `social:read` · Units: 1 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Pixeldrain viewer URL (https://pixeldrain.com/u/<id>) or the file id. (e.g. 5UZcgpfV) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `bandwidth` (integer (int64)), `downloads` (integer (int64)), `id` (string), `paidBandwidth` (integer (int64)), `views` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/pixeldrain/stats?url=5UZcgpfV" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
