# Pinterest Explorer 📌 (`jupri/pinterest-explorer`) Actor

💫 All-in-One Pinterest.com Scraper

- **URL**: https://apify.com/jupri/pinterest-explorer.md
- **Developed by:** [cat](https://apify.com/jupri) (community)
- **Categories:** Social media, Videos
- **Stats:** 502 total users, 5 monthly users, 64.2% runs succeeded, 18 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 💫 Welcome To Pinterest Explorer

<img align="right" height="32" src="https://apify.com/actor-badge?actor=LJ5EVniB0ulV4RfGP">

![don't be sad readme is here](https://raw.githubusercontent.com/JupriGH/resources/main/cats/catframe.png)

### About Pinterest.com

<img align="right"  src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/Pinterest_Logo.svg/330px-Pinterest_Logo.svg.png">

**Pinterest** is an American [image sharing](https://en.wikipedia.org/wiki/Image_sharing "Image sharing") and [social media service](https://en.wikipedia.org/wiki/Social_media_service "Social media service") designed to enable saving and discovery of information (specifically "ideas")[\[6\]](https://en.wikipedia.org/wiki/Pinterest#cite_note-6) on the internet using images, and on a smaller scale, animated GIFs and videos,[\[7\]](https://en.wikipedia.org/wiki/Pinterest#cite_note-7) in the form of [pinboards](https://en.wikipedia.org/wiki/Bulletin_board "Bulletin board").[\[8\]](https://en.wikipedia.org/wiki/Pinterest#cite_note-8) The site was created by [Ben Silbermann](https://en.wikipedia.org/wiki/Ben_Silbermann "Ben Silbermann"), [Paul Sciarra](https://en.wikipedia.org/wiki/Paul_Sciarra "Paul Sciarra"), and [Evan Sharp](https://en.wikipedia.org/wiki/Evan_Sharp "Evan Sharp"), and had 450 million [global monthly active users](https://en.wikipedia.org/wiki/Monthly_active_users "Monthly active users") as of December 2022.[\[5\]](https://en.wikipedia.org/wiki/Pinterest#cite_note-q4-2022-5) It is operated by **Pinterest, Inc.**, based in [San Francisco](https://en.wikipedia.org/wiki/San_Francisco "San Francisco").

### 📌 About This Actor

Use this Actor to scrape data from Pinterest.com, including profile, pins, boards, sections, search for pins visual similarity, etc.

#### 🍿 Features :

- ⭐ Scrape Profile, Pins, Boards, Section
- ⭐ Scrape using URL
- ⭐ Search for visual similarity (using URL)
- ⭐ Sort images by similarity *(coming soon)*
- ⭐ Generate Slide-Show
- ⭐ Minimal input
- ⭐ Fast like The Flash

### 📌 Input Parameters

| Parameter | Type | Description |
|-|-|-|
| `query`| **string array** | See below for possible query values |
| `limit` | **integer** | Number of results (per query) |
| `gallery` | **boolean** | Generate HTML gallery/viewer |

### 📌 HTTP Cookies

Some function may require a cookie value from your HTTP session. For example: products search, etc (*see below*). You may want to include additional HTTP cookie, for example your **Login Cookie** named **\_pinterest_sess** (*this is just example, use at your own risk!*).

- Login to Pinterest.com, and get cookie value named: `_pinterest_sess` from domain: `https://www.pinterest.com`
- Open **☢️ Advanced Options** then copy paste:

![enter image description here](https://apify-uploads-prod.s3.us-east-1.amazonaws.com/AdeZJ1jSfAdn3z695-image.png)

### 📌 Advanced Usage

#### 🍿 Pinterest Query Language (PQL)

```html
[ <COMMAND:> | # | @ ] [ <NAME> | <ID> | <KEYWORD> | <URL> ] [ /<SECTION> ] 
```

#### 🍿 Possible QUERY  values

| Format | Example | Description |
|-|-|-|
|**<*KEYWORDS*>** | `wood furniture` |***Search Anything***|
|`KEYWORDS` |`square pants`|Search pins|
|`videos:<KEYWORDS>` |`videos:wooden chairs`|Search videos|
|`boards:<KEYWORDS>` |`boards:yellow cats` |Search boards|
|`users:<KEYWORDS>` |`users:apify`|Search users|
|`stories:<KEYWORDS>` |`stories:garden`|Search stories |
|`products:<KEYWORDS>` |`products:computer`|Search products <br> *(cookie required)*|
|**#<*TOPIC*>**| `#art` or `#961238559656` |***Idea (topic/interest)***|
|**topic:<*TOPIC*>**| `topic:961238559656` | |
|`/info`| `#art/info`|Topic info and stats|
|`/pins`| `#art/pins`|Topic related pins|
|`/videos`| `#art/videos`|Topic related videos|
|**<*PIN*>** | `1234567890` | ***Pin (post) Data***|
|`/info`|`1234567890/info`|Pin info and stats|
|`/related`|`1234567890/related`|Related pins|
|`/comments`|`1234567890/comments`|Pin comments|
|`/visual`|`1234567890/visual`|Pin visual search|
|`/products`|`1234567890/products`|Pin related products <br>*(cookie required)*|
|**@<*USER*>** | `@microsoft` | ***User Data***|
|`/info` | `@microsoft/info`|User info|
|`/followers`|`@microsoft/followers`|User followers|
|`/following`|`@microsoft/following`|User following|
|`/pins`|`@microsoft/pins`|User pins|
|`/boards`|`@walmart/boards`|User boards|
|`/created`|`@walmart/created`|User created pins|
|`/products`|`@amazon/products`|User (seller) products|
|**@<*USER*>:<*BOARD*>**|`@microsoft:travel`|***Board Data***
|**board:<*BOARD_ID*>**|`board:120013001`|***Board Data (by board ID)***
|`/info`|`board:120013001/info`|Board info|
|`/sections`|`board:120013001/sections`|Board section (sub-folders)|
|`/pins`|`board:120013001/pins`|Board pins|
|`/members`|`board:120013001/members`|Board members (collaborators)|
|`/followers`|`board:120013001/followers`|Board followers|
|`/ideas`| `board:120013001/ideas` | More pins (ideas)
|**@<*USER*>:*BOARD:SECTION***|`@microsoft:travel:india`| ***Sub-board Data***
|**section:<*SECTION_ID*>**|`section:310002100`| ***Sub-board (by section ID)***
|`/info`|`section:310002100/info`|Sub-board info|
|`/pins`|`section:310002100/pins`|Sub-board pins|
|**https:<*URL*>** | `https://*.pinterest.com/...` |***Start URL***|
| `/search/<TYPE>/?q=KEYWORD`| | Search for pins specific type |
| `/ideas/<TOPIC>/<TOPIC_ID>` | |Search specific topic/interest
| `/pin/<PIN>`| `https://id.pinterest.com/pin/1234567890` | User pin related |
| `/pin/<PIN>/visual-search`| |User pin visual search  |
| `/<USER>`| `https://id.pinterest.com/microsoft` | User info |
| `/<USER>/pins`| | User pins |
| `/<USER>/_created` | |User created pins |
| `/<USER>/_saved` | |User boards |
| `/<USER>/<BOARD>` | |Board pins |
| `/<USER>/<BOARD>/<SECTION>` | | Board sub-folder pins |

### 📌 Tutorial

#### 🍿 Example #1: Searching

Searching for pins

```yaml
{ "query": ["Window and Furniture"] }
```

Searching for videos only

```yaml
{ "query": ["vidoes:Cat House"] }
```

Searching for products

```yaml
{ "query": ["products:Square Pants"] }
```

#### 🍿 Example #2: User Profile

User/profile info and stats

```yaml
{ "query": ["@microsoft/info"] }
```

User boards list

```yaml
{ "query": ["@microsoft/boards"] }
```

User products list

```yaml
{ "query": ["@amazon/products"] }
```

#### 🍿 Example #3: Number of Results

Use LIMIT to increase or limit number of results (per-query)

```yaml
{ "query": ["@microsoft/pins"], "limit": 100 }
```

#### 🍿 Example #4: Board and Section Pins

User Board pins

```yaml
{ "query": ["@microsoft:travel/pins"], "limit": 100 }
```

User Board may have sub-boards (sections)

```yaml
{ "query": ["@microsoft:travel:india/pins"], "limit": 100 }
```

For Board more detail info, use query `board:<BOARD_ID>` <br> Use query `@USER/boards` to get list of user boards and its `ID`

```yaml
{ "query": ["board:12300100002/info"] } 				# board info
{ "query": ["board:12300100002/pins"], "limit": 100 } 	# board pins
```

Board sub-folders list

```yaml
{ "query": ["board:12300100002/sections"], "limit": 100 } 
```

#### 🍿 Example #5:  Pin Info

Pin info and statistics

```yaml
{ "query": ["1234567890/info"] }
```

Pin related pins

```yaml
{ "query": ["1234567890/related"], "limit": 50 }
```

Pin comments

```yaml
{ "query": ["1234567890/comments"], "limit": 50 } 
```

#### 🍿 Example #6:  URL

As last resort, you can copy and paste an URL

```yaml
{ "query": ["https://id.pinterest.com/microsoft/"] }
```

#### 🍿 Example #7:  Multiple Queries

Multiple user info

```yaml
{ 
	"query": [
		"@google/info",
		"@walmart/info",
		"@apify/info"
	]
}
```

Multiple user pins

```yaml
{ 
	"query": [
		"@amazon/products",
		"@walmart/products",
		"@nike/products",
		"@apify/pins",
		"videos:yellow cat"
	],
	"limit": 10 # 10 results per-query
}
```

Different `QUERY` may have different attributes set.  <br> You can combine different type of `QUERY` in a single request but not recommended.

```yaml
{ 
	"query": [
		"@google/info",			
		"120000199922/info", 	
		"#art/info"
	]
}
```

### 📌 Output Samples

#### 🍿 Sample #1: JSON Output

```yaml
{
    "board": {
        "name": "Lưu nhanh",
        "url": "/bch7946/_quick_saves/"
    },
    "created_at": "Tue, 14 Mar 2023 15:23:53 +0000",
    "domain": "tracking.feedpress.it",
    "grid_title": "Microsoft Ads Introduces Cookie-Based Experiment Feature",
    "id": "1066438386741918409",
    "image_crop": {
        "max_y": 1
    },
    "image_signature": "1cc0030a7989dbcfe3b6b58d0f06f58c",
    "images": {
        "170x": {
            "height": 123,
            "url": "https://i.pinimg.com/236x/1c/c0/03/1cc0030a7989dbcfe3b6b58d0f06f58c.jpg",
            "width": 236
        },
        "236x": {
            "height": 123,
            "url": "https://i.pinimg.com/236x/1c/c0/03/1cc0030a7989dbcfe3b6b58d0f06f58c.jpg",
            "width": 236
        },
        "474x": {
            "height": 248,
            "url": "https://i.pinimg.com/474x/1c/c0/03/1cc0030a7989dbcfe3b6b58d0f06f58c.jpg",
            "width": 474
        },
        "736x": {
            "height": 386,
            "url": "https://i.pinimg.com/736x/1c/c0/03/1cc0030a7989dbcfe3b6b58d0f06f58c.jpg",
            "width": 736
        },
        "orig": {
            "height": 840,
            "url": "https://i.pinimg.com/originals/1c/c0/03/1cc0030a7989dbcfe3b6b58d0f06f58c.png",
            "width": 1600
        }
    },
    "is_uploaded": true,
    "link": "http://tracking.feedpress.it/link/13962/13489926",
    "pinner": {
        "full_name": "Trâm Bích",
        "id": "1066438524171071800",
        "image_large_url": "https://s.pinimg.com/images/user/default_140.png",
        "image_medium_url": "https://s.pinimg.com/images/user/default_75.png",
        "image_small_url": "https://s.pinimg.com/images/user/default_30.png",
        "username": "bch7946"
    },
    "reaction_counts": {
        "1": 1
    },
    "rich_summary": {
        "display_description": "Microsoft Ads added an additional feature to the Experiment functionality launched last July: cookie-based audience specifications.",
        "display_name": "Microsoft Ads Introduces Cookie-Based Experiment Feature",
        "favicon_images": {
            "orig": "https://i.pinimg.com/favicons/e4793202be714776e9ec57cd8452dea6839302dcaf946ff7c8a69e07.png?9292791bfd447d72ea6e3c05a904eb89"
        },
        "favicon_link": "https://i.pinimg.com/favicons/e4793202be714776e9ec57cd8452dea6839302dcaf946ff7c8a69e07.png?9292791bfd447d72ea6e3c05a904eb89",
        "id": "0c15d83843dccc4039dbbb3091133efd",
        "site_name": "Search Engine Journal",
        "type": "richpingriddata",
        "type_name": "article",
        "url": "http://tracking.feedpress.it/link/13962/13489926"
    },
    "type": "pin"
}
```

#### Sample #2: Simple HTML Gallery

![enter image description here](https://raw.githubusercontent.com/JupriGH/resources/main/slide.png)

### 📌 Support

<img src="https://apify-uploads-prod.s3.us-east-1.amazonaws.com/5SxZhwYwpknFk8ek9-cat.gif" width="240">

- ⚡️ Congratulation! you have mastered ***"How to scrape Pinterest using APIFY Pinterest Explorer"***
- ⚡️ Feel free to [reach out](https://console.apify.com/actors/LJ5EVniB0ulV4RfGP/issues) to the developer for any issues or suggestions for improvement.

# Actor input Schema

## `query` (type: `array`):

💡 <b>Possible Values :</b><br><br><code><i><li>KEYWORDS</li><li>@USERNAME\[/BOARD]</li><li>#IDEAS</li><li>PIN_ID</li><li>PIN_ID/comments</li><li>PIN_ID/related</li><li>PIN_ID/visual</li><li>URL</li></i></code></div>

## `example` (type: `string`):

💡 QUERY Input examples: Please clear the QUERY input before running an example.

## `limit` (type: `integer`):

💡 Number of results (per-query)

## `domains` (type: `array`):

💡 <b><i>examples:</i></b> <code>"ebay.com"</code>, <code>"amazon.com"</code>, <code>"etsy.com"</code>

## `price_min` (type: `integer`):

No description

## `price_max` (type: `integer`):

No description

## `gallery` (type: `boolean`):

💡 Generate simple HTML gallery (HTML5 + CSS3). The gallery will be saved to default <code>Key-Value</code> storage

## `dev_proxy_config` (type: `object`):

💡 <b>Supported protocol:</b><br><br><b>HTTP(S), SOCKS5</b><br><code>{http|socks5}://{user:pass}@{hostname|ip-address}:port</code><br><br><b>Example</b>: <code>socks5://example.com:9000</code>

## `dev_custom_headers` (type: `array`):

💡 Additional HTTP Headers

## `dev_custom_cookies` (type: `array`):

💡 Additional HTTP Cookies

## `dev_transform_fields` (type: `array`):

💡 <b>Transform the resulting output. Select only needed fields.</b><br><br>For nested object use <b>DOT</b>. For example: <pre>address.streetAddress</pre><br>For nested array use <b>NUMBER</b> <i>(index of array element starting from index=0)</i>. For example: <pre>images.0.url</pre>

## `dev_dataset_name` (type: `string`):

💡 <b>Save results into custom named Dataset, use mask to customize dataset name</b><br><br><code>{ACTOR} = actor name<br>{DATE} = date (YYYYMMDD)<br>{TIME} = time (HHMMSS)</code><br><br>This masks can be used to autogenerate Dataset Name.<br><br>example: <i><code>data-{DATE}</code></i><br>Depending on today date the dataset name will be: <code>data-20230603</code><i><br><br>default: <code>data-{ACTOR}-{DATE}-{TIME}</code></i>

## `dev_dataset_clear` (type: `boolean`):

Clear Dataset before insert/update.

## `dev_no_strip` (type: `boolean`):

💡 Keep/Save empty values <i><code>(NULL, FALSE, empty ARRAY, empty OBJECT, empty STRING)</code></i>

## `dev_fileupload` (type: `string`):

💡 Upload your file and copy & paste the URL somewhere.

## Actor input object example

```json
{
  "query": [
    "square pants"
  ],
  "limit": 5,
  "dev_custom_cookies": [
    {
      "key": "_pinterest_sess",
      "value": ""
    }
  ]
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": [
        "square pants"
    ],
    "limit": 5,
    "dev_custom_cookies": [
        {
            "key": "_pinterest_sess",
            "value": ""
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jupri/pinterest-explorer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": ["square pants"],
    "limit": 5,
    "dev_custom_cookies": [{
            "key": "_pinterest_sess",
            "value": "",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("jupri/pinterest-explorer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": [
    "square pants"
  ],
  "limit": 5,
  "dev_custom_cookies": [
    {
      "key": "_pinterest_sess",
      "value": ""
    }
  ]
}' |
apify call jupri/pinterest-explorer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jupri/pinterest-explorer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LJ5EVniB0ulV4RfGP/builds/0o6b6IMbToWzGzcnj/openapi.json
