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

# Pinterest search

> Read a Pinterest pin or video search page with a q query as JSON with the pinterest-search parser. $1 per 1,000 calls. Send the page to scrape.

Reads a Pinterest pin or video search page with a q query, like pinterest.com/search/pins/?q=kitchen, and returns a list of posts as JSON.

## Make a request

Send the page's URL to [scrape](https://docs.stophy.dev/api-reference/endpoint/scrape.md) with a `json` format that names the parser. Get an API key in the [Quickstart](https://docs.stophy.dev/quickstart).

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/scrape \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.pinterest.com/search/pins/?q=kitchen%20ideas","formats":[{"type":"json","parser":"pinterest-search"}]}'
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.stophy.dev/v1/scrape", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STOPHY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://www.pinterest.com/search/pins/?q=kitchen%20ideas",
    formats: [{ type: "json", parser: "pinterest-search" }],
  }),
});
console.log(await response.json());
```

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

import requests

response = requests.post(
    "https://api.stophy.dev/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['STOPHY_API_KEY']}"},
    json={
        "url": "https://www.pinterest.com/search/pins/?q=kitchen%20ideas",
        "formats": [{"type": "json", "parser": "pinterest-search"}],
    },
)
print(response.json())
```

## Read the response

The parser's data is in `data.json`. Its fields include `results`, `cursor`, `page` and `total`. This sample is cut to the first items.

```json theme={null}
{
  "success": true,
  "data": {
    "json": {
      "results": [
        {
          "id": "https://www.tilebar.com/montauk-gin-2x8-ceramic-wall-tile-satin.html",
          "url": "https://www.tilebar.com/montauk-gin-2x8-ceramic-wall-tile-satin.html",
          "title": "Explore Montauk Gin 2x8 White Ceramic Subway Wall Tile with Mixed Finish",
          "text": "The Montauk Gin 2x8 White Ceramic Wall Tile reimagines the subway format in durable ceramic-with a distinctively…",
          "author": {
            "id": "0",
            "name": "Example user",
            "handle": "example_user",
            "url": "https://example.com/example_user",
            "avatarUrl": null,
            "isVerified": null
          },
          "community": {
            "name": "Tiles & Backsplashes",
            "url": "https://www.pinterest.com/TileBar/tiles-backsplashes/"
          },
          "publishedAt": "2024-01-14T07:22:59.000Z",
          "likes": 63,
          "comments": null,
          "shares": null,
          "views": null,
          "media": [
            {
              "type": "image",
              "url": "https://i.pinimg.com/originals/bc/54/e8/bc54e89cd5e3e093314c3349401ec38e.png",
              "width": 1000,
              "height": 1600,
              "altText": "a kitchen with wooden cabinets and white counter tops",
              "durationSeconds": null
            }
          ],
          "hashtags": [],
          "saves": null,
          "linkUrl": "https://www.tilebar.com/montauk-gin-2x8-ceramic-wall-tile-satin.html",
          "domain": "tilebar.com",
          "dominantColor": "#846c4c",
          "isPromoted": false,
          "boardId": "101049654078317541"
        }
      ],
      "cursor": "Y2JVSG81V2sxcmNHRlpWM1J5VFVad1YxWllaR3hpVmtZMldWVlZNVll4U2xkWFZFSlhVbnBHTTFVeWN6RlNhelZXVm14S1dGSXlhRkpXVjNSV1pVVTFSMVZZYUZaaVZGWlFWbXhvVTJWV1pISlhhM1JYVm10V...",
      "page": null,
      "total": null
    }
  }
}
```

## Options

Send options in the `options` object of the `json` format.

| Option | What it does |
| - | - |
| `cursor` | The cursor from the previous response. Send it as is. |

It also takes `type`.

## Price

\$1 per 1,000 calls. See [Pricing](https://docs.stophy.dev/account/pricing.md).

## Limits and errors

* The URL must be a Pinterest pin or video search page with a q query, like pinterest.com/search/pins/?q=kitchen. Any other URL fails with `invalidRequest`.
* To read the next page, send the `cursor` from the response as the `cursor` option. Paging needs an API key.
* The answer comes back in `data.json`. If the page cannot be read, the call fails with an error code from [Errors](https://docs.stophy.dev/api-reference/errors.md).

## Related

* [Pre-built parsers](https://docs.stophy.dev/scrape/prebuilt-parsers) lists every parser.
* [Scrape](https://docs.stophy.dev/scrape/overview) has the options every scrape takes.
* [Pinterest pin](https://docs.stophy.dev/scrape/prebuilt-parsers/social/pinterest-pin.md)
* [Pinterest board](https://docs.stophy.dev/scrape/prebuilt-parsers/social/pinterest-board.md)
* [Pinterest profile](https://docs.stophy.dev/scrape/prebuilt-parsers/social/pinterest-profile.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.