# Pinterest Scraper — Pins, Boards, Profiles & Search (`codecrawler/pinterest-scraper`) Actor

Extract comprehensive data from Pinterest: pins, boards, creator profiles, keyword search results, trending boards, and engagement metrics.

- **URL**: https://apify.com/codecrawler/pinterest-scraper.md
- **Developed by:** [CodeCrawler](https://apify.com/codecrawler) (community)
- **Categories:** Social media, E-commerce, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 📌 Pinterest Scraper — Apify Actor

Extract structured data from Pinterest at scale: **pins, boards, user profiles, keyword searches, and trending content** — all with engagement metrics.

Built with **Crawlee + Playwright + Apify SDK**.

***

### ✨ Features

| Feature | Description |
|---------|-------------|
| 🖼️ **Pin Extraction** | Get pin details: images, videos, descriptions, links, creator info |
| 📋 **Board Scraping** | Extract board metadata + all pins within a board |
| 👤 **User Profiles** | Full profile data: bio, stats, boards, recent pins |
| 🔍 **Keyword Search** | Search Pinterest by keyword with automatic pagination |
| 🔥 **Trending/Discovery** | Get trending boards and popular content |
| 📊 **Engagement Metrics** | Saves, comments, reactions, followers, monthly views |
| 🔄 **Auto-Pagination** | Follows bookmark cursors until hitting your configured limit |
| 🛡️ **Anti-Detection** | Session rotation, browser fingerprinting, residential proxies |

***

### 🚀 Quick Start

#### On Apify Platform

1. Go to [Apify Store](https://apify.com/store) and find **Pinterest Scraper**
2. Click **Try for free**
3. Configure your input (see below)
4. Run and download results

#### Locally

```bash
## Clone and install
cd pinterest-scraper
npm install

## Create input file
cat > ./storage/key_value_stores/default/INPUT.json << 'EOF'
{
    "keywords": ["minimalist interior design"],
    "maxResultsPerEndpoint": 50
}
EOF

## Run
npm start
```

***

### 📥 Input Configuration

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `urls` | `string[]` | `[]` | Direct Pinterest URLs (pins, boards, profiles) |
| `keywords` | `string[]` | `[]` | Search queries |
| `usernames` | `string[]` | `[]` | Usernames to extract profiles |
| `boards` | `string[]` | `[]` | Board paths (`username/board-name`) |
| `maxResultsPerEndpoint` | `integer` | `1000` | Max results per keyword/user/board |
| `includeEngagementMetrics` | `boolean` | `true` | Include saves, comments, followers |
| `outputFormat` | `string` | `"json"` | Output format: `json`, `csv`, `jsonl` |
| `proxyUrl` | `string` | `""` | Custom proxy URL (optional) |
| `cookies` | `string[]` | `[]` | Pre-set session cookies (optional) |

#### Example Input

```json
{
    "urls": [
        "https://www.pinterest.com/pin/123456789/",
        "https://www.pinterest.com/nike/"
    ],
    "keywords": ["fashion trends 2025", "home office ideas"],
    "usernames": ["nike", "wholefoodsmarket"],
    "boards": ["nike/just-do-it"],
    "maxResultsPerEndpoint": 500,
    "includeEngagementMetrics": true,
    "outputFormat": "json"
}
```

***

### 📤 Output Format

#### Pin

```json
{
    "id": "123456789",
    "type": "pin",
    "title": "Summer Outfit Ideas",
    "description": "Perfect summer looks for 2025...",
    "link": "https://example.com/article",
    "url": "https://www.pinterest.com/pin/123456789/",
    "dominantColor": "#e8d5b7",
    "images": {
        "small": "https://i.pinimg.com/236x/...",
        "medium": "https://i.pinimg.com/474x/...",
        "large": "https://i.pinimg.com/736x/...",
        "original": "https://i.pinimg.com/originals/..."
    },
    "video": null,
    "creator": {
        "id": "987654321",
        "username": "fashionbrand",
        "fullName": "Fashion Brand Official",
        "avatarUrl": "https://.../"
    },
    "board": {
        "id": "111222333",
        "name": "Summer Collection",
        "url": "/fashionbrand/summer-collection/"
    },
    "engagement": {
        "saves": 15420,
        "comments": 234,
        "reactions": {}
    },
    "metadata": {
        "createdAt": "2025-06-15T10:30:00Z",
        "isPromoted": false,
        "isVideo": false,
        "isShoppable": true,
        "domain": "example.com",
        "richMetadata": null
    },
    "scrapedAt": "2025-07-05T06:00:00Z"
}
```

#### Board

```json
{
    "id": "111222333",
    "type": "board",
    "name": "Summer Collection",
    "description": "Our best summer looks",
    "url": "https://www.pinterest.com/fashionbrand/summer-collection/",
    "privacy": "public",
    "owner": {
        "id": "987654321",
        "username": "fashionbrand",
        "fullName": "Fashion Brand Official"
    },
    "engagement": {
        "pinCount": 342,
        "followerCount": 12500,
        "collaboratorCount": 0
    },
    "pins": [ ... ]
}
```

#### User Profile

```json
{
    "id": "987654321",
    "type": "user",
    "username": "fashionbrand",
    "fullName": "Fashion Brand Official",
    "bio": "Inspiring style since 2010",
    "profileUrl": "https://www.pinterest.com/fashionbrand/",
    "avatarUrl": "https://.../",
    "engagement": {
        "followerCount": 250000,
        "followingCount": 120,
        "pinCount": 5430,
        "boardCount": 28,
        "monthlyViews": 1500000
    },
    "boards": [ ... ],
    "recentPins": [ ... ]
}
```

***

### 🏗️ Architecture

```
pinterest-scraper/
├── apify.json               # Actor manifest & input schema
├── Dockerfile               # node:20 + Playwright + Chromium
├── package.json
├── README.md
├── INPUT_SCHEMA.md
└── src/
    ├── index.js              # Entry point — orchestrator
    ├── config.js             # API endpoints, headers, rate limits
    ├── controllers/
    │   ├── pinController.js      # Pin extraction
    │   ├── boardController.js    # Board metadata + pin listing
    │   ├── userController.js     # User profiles + boards + pins
    │   └── searchController.js   # Search, trending, discovery
    └── utils/
        ├── httpClient.js         # Authenticated HTTP client
        └── parser.js             # Response normalization
```

#### Data Flow

```
Input (URLs/keywords/usernames/boards)
  │
  ▼
PlaywrightCrawler → Visit pinterest.com → Extract cookies + CSRF
  │
  ▼
PinterestHttpClient (authenticated fetch)
  │
  ├──▶ PinController     → /resource/PinResource/get/
  ├──▶ BoardController   → /resource/BoardResource/get/
  ├──▶ UserController    → /resource/UserResource/get/
  └──▶ SearchController  → /resource/BaseSearchResource/get/
         │
         ▼
    Parser (normalize JSON) → Apify Dataset
```

***

### ⚙️ Technical Details

#### Authentication

The Actor uses Playwright to visit Pinterest and obtain session cookies + CSRF token automatically. Optionally, you can provide pre-set cookies in the input for faster startup.

#### Rate Limiting

- **40 requests/minute** (configurable)
- **1.5 second** delay between API calls
- **3 retries** on failure with exponential backoff
- Max concurrency: **5** parallel requests

#### Pagination

All Pinterest endpoints use bookmark-based cursor pagination. The Actor follows cursors until results are exhausted or the `maxResultsPerEndpoint` limit is reached.

#### Proxy Strategy

- Uses Apify residential proxies by default when running on the platform
- Supports custom proxy URLs for self-hosted runs
- Session rotation on proxy failures

***

### 💰 Pricing Estimate

| Volume | Est. Cost | Notes |
|--------|-----------|-------|
| 100 results | ~$0.20 | Quick test |
| 1,000 results | ~$1.99 | Standard run |
| 10,000 results | ~$15 | Large extraction |
| 100,000 results | ~$120 | Enterprise batch |

*Costs depend on proxy usage, compute time, and Apify plan.*

***

### 📋 Limitations

- Pinterest may change internal API endpoints without notice
- Anonymous sessions have lower rate limits than authenticated ones
- Video content URLs may expire after a few hours
- Some promoted/ad pins may have limited metadata

***

### 📄 License

ISC

# Actor input Schema

## `urls` (type: `array`):

Direct URLs to Pinterest pins, boards, or user profiles to scrape.

## `keywords` (type: `array`):

Keywords to search on Pinterest. Returns pins matching each keyword.

## `usernames` (type: `array`):

Pinterest usernames to extract full profiles (boards + recent pins).

## `boards` (type: `array`):

Board paths in 'username/board-name' format to extract board data + pins.

## `maxResultsPerEndpoint` (type: `integer`):

Maximum number of results to extract per keyword, user, or board.

## `includeEngagementMetrics` (type: `boolean`):

Include saves, comments, reactions, and follower counts in the output.

## `outputFormat` (type: `string`):

Format of the output dataset.

## `proxyUrl` (type: `string`):

Optional proxy URL. If empty, the Actor uses Apify's automatic proxy.

## `cookies` (type: `array`):

Optional pre-set cookie strings for authentication. If empty, the Actor will create a fresh anonymous session.

## Actor input object example

```json
{
  "urls": [
    "https://www.pinterest.com/pin/424605071145421203/",
    "https://www.pinterest.com/pinterest/ideas-for-your-summer-escape/",
    "https://www.pinterest.com/pinterest/"
  ],
  "keywords": [
    "fashion trends 2025",
    "interior design minimalist"
  ],
  "usernames": [
    "pinterest",
    "nike",
    "target"
  ],
  "boards": [
    "pinterest/ideas-for-your-summer-escape",
    "pinterest/spice-up-your-dinner-plans"
  ],
  "maxResultsPerEndpoint": 1000,
  "includeEngagementMetrics": true,
  "outputFormat": "json",
  "proxyUrl": "",
  "cookies": []
}
```

# 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 = {
    "urls": [
        "https://www.pinterest.com/pin/424605071145421203/",
        "https://www.pinterest.com/pinterest/ideas-for-your-summer-escape/",
        "https://www.pinterest.com/pinterest/"
    ],
    "keywords": [
        "fashion trends 2025",
        "interior design minimalist"
    ],
    "usernames": [
        "pinterest",
        "nike",
        "target"
    ],
    "boards": [
        "pinterest/ideas-for-your-summer-escape",
        "pinterest/spice-up-your-dinner-plans"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("codecrawler/pinterest-scraper").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 = {
    "urls": [
        "https://www.pinterest.com/pin/424605071145421203/",
        "https://www.pinterest.com/pinterest/ideas-for-your-summer-escape/",
        "https://www.pinterest.com/pinterest/",
    ],
    "keywords": [
        "fashion trends 2025",
        "interior design minimalist",
    ],
    "usernames": [
        "pinterest",
        "nike",
        "target",
    ],
    "boards": [
        "pinterest/ideas-for-your-summer-escape",
        "pinterest/spice-up-your-dinner-plans",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("codecrawler/pinterest-scraper").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 '{
  "urls": [
    "https://www.pinterest.com/pin/424605071145421203/",
    "https://www.pinterest.com/pinterest/ideas-for-your-summer-escape/",
    "https://www.pinterest.com/pinterest/"
  ],
  "keywords": [
    "fashion trends 2025",
    "interior design minimalist"
  ],
  "usernames": [
    "pinterest",
    "nike",
    "target"
  ],
  "boards": [
    "pinterest/ideas-for-your-summer-escape",
    "pinterest/spice-up-your-dinner-plans"
  ]
}' |
apify call codecrawler/pinterest-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/McmloByh2kgDtaHn7/builds/94xsa370RaEXNrfxe/openapi.json
