How to scrape Pinterest with Python: pins, boards, profiles and search
Scrape Pinterest pins, boards, profiles and search results with Python. Working code for image URLs, outbound links and save counts, plus the limits.
By the Scrape Everything team · · 5 min read
Pinterest is a search engine for images with a shop attached: every pin has a picture, a title, a board and, most of the time, a link to the website it came from. That makes it useful for visual trend research, product and competitor research, and image datasets. This guide shows how to scrape public Pinterest data with Python: search results, a profile's pins, a board and a single pin, with code you can paste and run.
The examples use the Scrape Everything Pinterest API, so there is no browser to drive and no proxy pool to rent. The first section is an honest look at the do-it-yourself routes, because for a one-off job they can be enough.
Three ways to build a Pinterest scraper in Python
| Approach | How it works | Where it breaks |
|---|---|---|
requests + parsing | Load a Pinterest page and read the JSON embedded in the HTML, or call the site's internal /resource/.../get/ endpoints. | The page is rendered by JavaScript, so the first HTML holds little data. The internal endpoints need the right headers and change without notice. Datacenter IPs get blocked quickly. |
| Headless browser (Playwright, Selenium) | Open the page like a visitor, scroll, and read pins from the DOM or from intercepted network responses. | Slow and heavy: one browser per session, login walls after some scrolling, and selectors that break when the layout changes. |
| Scraper API | One HTTP request per search, profile, board or pin returns JSON. Keeping the scraper working is the provider's job. | You pay per request and get public data only, nothing more. |
Pinterest's official API (v5) is a fourth option, but it is built around the account that authorizes your app: its own pins, boards and ads. It needs an approved developer app and OAuth, and it is the right tool when you manage accounts. It is not designed for looking up arbitrary public profiles, boards or search results, which is what a scraper does.
What you can get from public Pinterest
| Endpoint | Input | Returns | Credits |
|---|---|---|---|
| Search | A keyword | Up to 50 pins in Pinterest's relevance order | 2 |
| Pins | A username | The profile plus up to 50 recent pins | 2 |
| Board | A board URL | Board details plus its first pins (about 25) | 2 |
| Pin | A pin URL or ID | One pin with its full engagement counts | 1 |
| Profile | A username | Followers, pins, boards, website and verification | 1 |
Every pin comes with the same fields: id, link, title, description, alt_text, dominant_color, image_url with image_width and image_height, is_video with video_url and video_duration_ms, outbound_link and outbound_domain, created_at, the board (board_name, board_url) and the pinner (pinner_username, pinner_full_name).
Step 1: get an API key
- Sign in. New accounts start with 100 free credits, enough for 50 searches or 100 single pins.
- Create a key on the API keys page.
- Store it in an environment variable called
SCRAPEEVERYTHING_API_KEY, and installrequestswithpip install requests.
Step 2: scrape Pinterest search results
Every endpoint is a POST with a small JSON body. This helper adds a timeout and retries the errors that are worth retrying, and the rest of the guide reuses it.
import os
import time
import requests
API = "https://api.scrapeeverything.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['SCRAPEEVERYTHING_API_KEY']}"}
def call(path: str, payload: dict, attempt: int = 0) -> dict:
res = requests.post(f"{API}{path}", headers=HEADERS, json=payload, timeout=90)
if res.status_code in (429, 502, 503, 504) and attempt < 3:
time.sleep(int(res.headers.get("RateLimit-Reset") or 2 ** attempt))
return call(path, payload, attempt + 1)
body = res.json()
if not body["success"]:
raise RuntimeError(f"{body['code']}: {body['message']}")
return body["data"]
data = call("/pinterest/search", {"query": "minimalist kitchen", "limit": 50})
print(data["pins_fetched"], "pins, more available:", data["has_more"])
for pin in data["pins"]:
print(pin["id"], pin["title"][:60], pin["outbound_domain"]){
"id": "142567144449027286",
"link": "https://www.pinterest.com/pin/142567144449027286/",
"title": "...",
"description": "...",
"alt_text": "...",
"dominant_color": "#0b0b09",
"image_url": "https://i.pinimg.com/originals/...jpg",
"image_width": 1200,
"image_height": 1800,
"is_video": false,
"outbound_link": "https://example.com/...",
"outbound_domain": "example.com",
"created_at": "...",
"board_name": "...",
"pinner_username": "..."
}Step 3: download the images
image_url is the largest image Pinterest serves for the pin, the original upload when it is available. Downloading is a plain GET, streamed to disk and named after the pin ID so reruns overwrite instead of duplicating.
from pathlib import Path
def download_images(pins: list[dict], folder: str = "pins") -> int:
out = Path(folder)
out.mkdir(exist_ok=True)
saved = 0
for pin in pins:
url = pin.get("image_url")
if not url:
continue
ext = url.rsplit(".", 1)[-1].split("?")[0] or "jpg"
with requests.get(url, stream=True, timeout=60) as img:
img.raise_for_status()
with open(out / f"{pin['id']}.{ext}", "wb") as fh:
for chunk in img.iter_content(65536):
fh.write(chunk)
saved += 1
return saved
print(download_images(data["pins"]), "images saved")For video pins, is_video is true and video_url points at the highest resolution file. If you only need one image or one video now and then, the free Pinterest Image Downloader does the same in the browser without a key.
Step 4: scrape a profile's pins or a board
The pins endpoint returns the profile and its recent pins in one request. The board endpoint takes a board URL and returns the board's details with its first pins.
profile = call("/pinterest/pins", {"username": "nasa", "limit": 50})
print(profile["full_name"], profile["follower_count"], "followers")
print(len(profile["pins"]), "pins, more available:", profile["has_more"])
board = call("/pinterest/board", {"url": "https://www.pinterest.com/nasa/learn-with-nasa/", "limit": 25})
print(board["board"]["name"], board["board"]["pin_count"], "pins on the board")
print(len(board["pins"]), "pins returned")Two limits matter here. Only the first 25 or so pins of a board are available, so a board with 900 pins still returns about 25, and has_more tells you there are more. And each request returns one page: up to 50 pins for a profile or a search, with no cursor to fetch the next page.
Step 5: get the full engagement counts of a pin
Search results, profile pins and board pins carry fewer numbers than a single pin. In search results repin_count, comment_count, favorite_count and share_count are usually all null; profile and board pins usually have repin_count but not share_count. When you need them, look the pin up on its own. A common pattern is to search first, keep the pins that match your filter, and enrich only those.
pin = call("/pinterest/pin", {"url": "https://www.pinterest.com/pin/142567144449027286/"})
print(pin["repin_count"], "saves,", pin["reaction_count"], "reactions,", pin["comment_count"], "comments")Step 6: save the results to CSV
import csv
FIELDS = ["id", "link", "title", "description", "image_url", "is_video",
"outbound_link", "outbound_domain", "created_at", "board_name", "pinner_username"]
with open("pins.csv", "w", newline="", encoding="utf-8") as fh:
writer = csv.DictWriter(fh, fieldnames=FIELDS, extrasaction="ignore")
writer.writeheader()
writer.writerows(data["pins"])Grouping that file by outbound_domain answers a question marketers ask often: which websites and shops own a keyword on Pinterest. If you would rather skip the code, the same endpoints work from Google Sheets and n8n.
Errors, retries and what it costs
| Response | What it means | What to do |
|---|---|---|
404 NOT_FOUND | The profile, board or pin does not exist. | Do not retry. This is billed, because the lookup completed. |
429 RATE_LIMITED | More requests per minute than your plan allows. | Wait until RateLimit-Reset and retry. |
5xx / TARGET_BLOCKED / TIMEOUT | Pinterest blocked the request or something failed on our side. | Retry with backoff. These are refunded automatically. |
402 INSUFFICIENT_CREDITS | Your balance is lower than the endpoint cost. | Top up. Nothing was charged. |
A search that returns up to 50 pins costs 2 credits. On the Builder pack (25,000 credits for $19.99) that is about a sixth of a cent per search, and the pack covers 12,500 searches. Credits never expire, and sending cache_days returns a result your account already fetched within that window for 0 credits. Current numbers are on the pricing page.
Use the data responsibly
The API returns public data only: no secret boards, no private profiles. Public does not mean free of rules, though. The images belong to the people who made them, so collecting links, titles and counts for research is a different thing from re-publishing the pictures, which needs the owner's permission. Our overview of the legal side covers the questions to ask before you start.
FAQ
Can I scrape Pinterest without logging in?
Yes. Everything in this guide is public data, and no Pinterest account or developer app is involved.
How many pins can I get from one search?
Up to 50 per request, in Pinterest's relevance order, with promoted pins left out. To cover a topic more widely, run several related keywords and remove duplicates by pin ID.
Why does a board return only about 25 pins?
Only about the first 25 pins of a board are available. has_more is true when the board holds more pins than were returned.
Does it work for video pins?
Yes. is_video marks them, and video_url and video_duration_ms are filled for video pins and null on image pins.
Is there a free Pinterest scraper?
New accounts get 100 free credits, which is 50 searches or 100 single pins, and the free tools on this site need no account at all. For larger jobs, credits are bought in one-time packs with no subscription.
Next steps
- Run a search in the browser playground after signing in, before writing any code.
- Read the Pinterest API reference for every field and parameter.
- See the other platforms that use the same key and response format on the scrapers page.