# Pinterest Image Downloader (`codingfrontend/pinterest-image-downloader`) Actor

Download images shown on public Pinterest search or pin pages and save a dataset record for each completed image.

- **URL**: https://apify.com/codingfrontend/pinterest-image-downloader.md
- **Developed by:** [Coding Frontned](https://apify.com/codingfrontend) (community)
- **Categories:** Videos, Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 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.

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

## 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

## Pinterest Image Downloader

Downloads images that Pinterest exposes on ordinary public search and pin pages. Each successful image is validated, stored in the default key-value store, and accompanied by a dataset record that describes the actual downloaded file.

The Actor returns images available from public Pinterest pages. Optional pin details are included only when the page exposes them.

### Input

| Field | Meaning | Default |
| --- | --- | --- |
| `mode` | `search` or `pinUrls` | `search` |
| `query` | Search phrase, 2–200 characters; required in search mode | `minimalist wallpaper` in Console |
| `pinUrls` | Up to 100 HTTPS Pinterest pin URLs with a numeric ID (optional public slug accepted) | none |
| `maxItems` | Hard cap on successfully downloaded images, 1–100 | `10` |
| `imageQuality` | Closest page-exposed candidate: `bestAvailable`, `736x`, `474x`, or `236x` | `bestAvailable` |
| `saveToDataset` | Legacy compatibility flag; image files are still stored, while `false` omits successful metadata rows | `true` |
| `requestTimeoutSecs` | Browser navigation and image-request timeout, 10–180 seconds | `30` |
| `maxRequestRetries` | Bounded browser request retries, 0–3 | `1` |

Example search input:

```json
{
  "mode": "search",
  "query": "minimalist wallpaper",
  "maxItems": 3,
  "imageQuality": "bestAvailable"
}
```

### Output contract

Only a completed image download produces a dataset item. Required fields include the numeric `pinId`, canonical `pinUrl`, final Pinterest CDN `imageUrl`, requested and downloaded variants, verified `contentType`, exact `byteLength`, `kvStoreKey`, source page, mode, original exposed `imageSourceUrl`, `sourceType`, and timestamp. Search rows also retain the exact query. Optional title, description, alt text, and dimensions are included only when the public page exposes them. Dimensions are source metadata, not decoded pixel measurements, and are omitted if retrieval redirects to another image URL.

The image file for a pin is stored in the key-value store with the key `image-{pinId}`. A dataset row is included only after the download is complete, and files are limited to 20 MiB. Optional fields are omitted when Pinterest does not expose them.

### Limitations and responsible use

- Some pins may be unavailable when Pinterest does not expose them on a public page.
- A requested width means the closest candidate already present in public page markup; it does not guarantee that exact resolution.
- Ensure your use of downloaded material respects Pinterest's terms, source-site terms, copyright, privacy, and applicable law.

# Changelog

This Actor's version history is a separate document: https://apify.com/codingfrontend/pinterest-image-downloader/changelog.md

# Actor input Schema

## `mode` (type: `string`):

Search public pin cards or process specific public pin URLs.

## `query` (type: `string`):

Two to 200 characters. Required in search mode.

## `pinUrls` (type: `array`):

Up to 100 HTTPS Pinterest pin URLs, with a numeric pin ID and an optional public slug. Required in specific-pin mode.

## `maxItems` (type: `integer`):

Hard cap on images that are successfully downloaded and recorded.

## `saveToDataset` (type: `boolean`):

Legacy compatibility flag. Image files are still validated/stored; when false, successful metadata is omitted from the dataset.

## `includeDiagnostics` (type: `boolean`):

Write a structured access/download diagnostic to the diagnostics key when no image is produced.

## `requestTimeoutSecs` (type: `integer`):

Timeout for browser navigation and image retrieval.

## `maxRequestRetries` (type: `integer`):

Bounded browser request retries.

## `imageQuality` (type: `string`):

Select the closest size already exposed by the public page. Best available chooses the widest exposed candidate.

## `proxyConfiguration` (type: `object`):

Optional Apify proxy settings. Disabled by default to avoid paid proxy use.

## Actor input object example

```json
{
  "mode": "search",
  "query": "minimalist wallpaper",
  "maxItems": 10,
  "saveToDataset": true,
  "includeDiagnostics": true,
  "requestTimeoutSecs": 30,
  "maxRequestRetries": 1,
  "imageQuality": "bestAvailable",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `images` (type: `string`):

No description

# 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": "minimalist wallpaper"
};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/pinterest-image-downloader").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": "minimalist wallpaper" }

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/pinterest-image-downloader").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": "minimalist wallpaper"
}' |
apify call codingfrontend/pinterest-image-downloader --silent --output-dataset

```

## MCP server setup

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

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/EDPNzFYyKUwrUn2B3/builds/thQM5WGnimmlfap4C/openapi.json
