# Pinterest Search (`pinterest.search`)

Search Pinterest pins by keyword and get titles, images, pinner and destination links, with cursor pagination.

Docs: https://primaryapi.com/docs/api-reference/pinterest/search

- Endpoint: `POST https://api.primaryapi.com/v1/run/pinterest.search`
- Category: Social · Platform: `pinterest` · Kind: search · Status: live
- Price: 2 credits per call; up to 36 credits if a call is retried elsewhere. A quote’s `maxCredits` is the most a given call can cost.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=pinterest.search`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `query` | string | yes |  | max 500 chars | Keyword, topic or brand to search Pinterest for (e.g. "mid-century living room"). |
| `type` | enum | no | "all-pins" | one of: all-pins | Result type. Only "all-pins" is served today (videos, boards and profiles have no reliable source yet). |
| `limit` | integer | no | 20 | 1–20 | Pins per page (1-20, default 20). A page cut short by limit continues exactly via nextCursor. |
| `cursor` | string | no |  |  | Opaque pagination cursor: pass the previous response's nextCursor. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `items` | object[] |  |
| `items[].id` | string | Pin id |
| `items[].title` | string \| null |  |
| `items[].description` | string \| null |  |
| `items[].image` | string \| null | Largest image URL available |
| `items[].url` | string \| null | Pin URL |
| `items[].videoUrl` | string \| null | Video URL for video pins (only some sources expose it) |
| `items[].author` | string \| null | Pinner username |
| `items[].authorName` | string \| null | Pinner display name |
| `items[].link` | string \| null | Outbound destination link of the pin |
| `items[].createdAt` | string \| null | ISO-8601 creation time |
| `nextCursor` | string \| null |  |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

Pagination: pass the previous response’s `nextCursor` as `cursor` to get the next page; `nextCursor: null` means there are no more results.

## Example request

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/pinterest.search" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"home decor","limit":10}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "items": [
        {
          "id": "string",
          "title": "string",
          "description": "string",
          "image": "string",
          "url": "https://example.com",
          "videoUrl": "https://example.com",
          "author": "string",
          "authorName": "string",
          "link": "string",
          "createdAt": "string"
        }
      ],
      "nextCursor": null
    }
  },
  "provider": "PrimaryAPI",
  "credits": 2,
  "items": 1,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z",
  "nextCursor": null
}
```

## Pricing and reliability

- Usual price: 2 credits per call
- Price ceiling: up to 36 credits if a call is retried elsewhere. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=pinterest.search`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

Cursors are pinned to the source that issued them. Pin images are third-party content: URLs only.

