# GIFs

1 endpoints.

## Search GIFs

```http
GET https://orbitwrite.com/api/v1/gifs/search
```

Searches GIPHY and returns a normalised result shape ready to attach to a post. With no `q`, returns what's trending. Results are rated pg-13. Anywhere these render must show a 'Powered by GIPHY' attribution.

**Authentication:** bearer token or session cookie.

### Query parameters

- `q` (string, optional) — Search terms. Omit or leave empty for trending GIFs.
- `limit` (integer, optional)
- `offset` (integer | null, optional) — Pagination cursor — pass the `next` from a prior page.

### Responses

#### 200

Matching GIFs

- `results` (Gif[], required)
  - `id` (string, required)
  - `description` (string, required)
  - `previewUrl` (string, required) — Small, fast variant for grid rendering.
  - `previewWidth` (integer, required)
  - `previewHeight` (integer, required)
  - `gifUrl` (string, required) — Standard-resolution GIF to attach to a post. Attach this URL directly — Orbitwrite does not re-host it, which keeps `sourceUrl` intact for adapters that embed rather than upload.
  - `gifWidth` (integer, required)
  - `gifHeight` (integer, required)
  - `gifBytes` (integer, optional)
  - `mp4Url` (string, optional) — MP4 alternative where GIPHY provides one. Platforms that publish GIFs as video (X, LinkedIn, Threads) need this to animate.
- `next` (string, optional) — Offset to pass as `offset` for the next page. Absent when there are no more results.

#### 400

Invalid request

- `error` (string, required)
- `issues` (any[], optional)

#### 401

Not signed in

- `error` (string, required)
- `issues` (any[], optional)

#### 429

Rate limit exceeded

- `error` (string, required)
- `issues` (any[], optional)

#### 502

An upstream provider failed

- `error` (string, required)
- `issues` (any[], optional)

#### 503

GIF search is not configured on this deployment

- `error` (string, required)
- `issues` (any[], optional)
