GitPedia

Py3 pinterest

Fully fledged Python Pinterest client

From bstoilovยทUpdated June 27, 2026ยทView on GitHubยท

**py3 pinterest** is a Fully fledged Python Pinterest client The project is written primarily in Python, distributed under the MIT License license, first published in 2019. Key topics include: board, boards, bot, client, cookies.

Latest release: 2.0.0
<p align="center"> <img src="https://upload.wikimedia.org/wikipedia/commons/0/08/Pinterest-logo.png" alt="Pinterest" width="100"> </p> <h1 align="center">py3-pinterest</h1> <p align="center"> <strong>The most complete unofficial Pinterest API client for Python</strong> </p> <p align="center"> <a href="https://pypi.org/project/py3-pinterest/"><img src="https://img.shields.io/pypi/v/py3-pinterest.svg?style=for-the-badge&logo=pypi&logoColor=white" alt="PyPI"></a> &nbsp; <a href="https://pypi.org/project/py3-pinterest/"><img src="https://img.shields.io/pypi/pyversions/py3-pinterest.svg?style=for-the-badge&logo=python&logoColor=white" alt="Python"></a> &nbsp; <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge" alt="License"></a> &nbsp; <a href="https://github.com/bstoilov/py3-pinterest/stargazers"><img src="https://img.shields.io/github/stars/bstoilov/py3-pinterest?style=for-the-badge&logo=github" alt="Stars"></a> </p> <br> <p align="center"> <b>๐Ÿ“Œ Pin</b> ยท <b>๐Ÿ“ค Upload Images & Videos</b> ยท <b>๐Ÿ“‹ Manage Boards</b> ยท <b>๐Ÿ‘ฅ Follow</b> ยท <b>๐Ÿ” Search</b> ยท <b>๐Ÿ’ฌ Comment & Message</b> </p> <p align="center"> <em>No API key needed. Works by mimicking browser requests to Pinterest's internal endpoints.</em> </p>

๐Ÿš€ What's New in v2.0.0

The comeback release. Nearly every core feature has been fixed, modernized, or rewritten.

Highlight
๐ŸŽฌVideo pin uploads โ€” full Story Pin / Idea Pin support via S3 upload flow
๐Ÿ–ผ๏ธImage uploads rewritten โ€” old broken /upload-image/ replaced with working S3 flow
๐Ÿ“„Pagination fixed โ€” reset_bookmark bug fixed across all 12 paginated methods
๐Ÿ”Login hardened โ€” cookie banner handling, language-independent selectors, proper cleanup
๐Ÿ—‘๏ธBoard deletion โ€” new delete_board() method
๐Ÿ“‚Board sections โ€” now supports page_size (up to 100, was hardcoded to 25)
๐Ÿ›ก๏ธNo more data loss โ€” Registry no longer rmtree's your directories on init
๐Ÿ“ฆDependency pins โ€” selenium>=4.0.0, webdriver-manager>=4.0.0
<details> <summary><b>๐Ÿ“‹ Full list of resolved issues (click to expand)</b></summary> <br>
IssueDescriptionStatus
#220Video upload not supportedโœ… Fixed
#219Login โ€” element not interactable (cookie banner)โœ… Fixed
#218Error in search (pin & board)โœ… Fixed
#217403 Forbidden โ€” _ngjs URL prefixโœ… Fixed
#213Search page size & paginationโœ… Fixed
#209pin() unexpected keyword image_pathโœ… Fixed
#208load_pin KeyError v3GetPinQueryโœ… Fixed
#207404 on PinResource/createโœ… Fixed
#205load_pin โ€” __PWS_DATA__ / props errorโœ… Fixed
#204401 Unauthorized on /upload-image/โœ… Fixed
#203get_user_pins stops short on large accountsโœ… Fixed
#202Timeout <object> error (selenium 3 + urllib3 2)โœ… Fixed
#200Downstream extruct issueโœ… N/A (dependency removed)
#195Login error โ€” ChromeDriver URL changeโœ… Fixed
#193Login fails for non-English localesโœ… Fixed
#191ChromeDriver download 404โœ… Fixed
#188404 on PinResource/createโœ… Fixed
#187get_board_sections limited to 25โœ… Fixed
#184Bad request โ€” can't create pinsโœ… Fixed
#181403 Forbidden on PinResource/createโœ… Fixed
#178Can't upload a new pinโœ… Fixed
#176Issue creating pinsโœ… Fixed
#175Can't post a new pinโœ… Fixed
#174Pinning fails with HTML outputโœ… Fixed
#156Credentials not storingโœ… Fixed
#148Facing problem with pinning imageโœ… Fixed
#147How to create video pins?โœ… Fixed
#139data/ directory automatic removalโœ… Fixed
#138KeyError resources in load_pinโœ… Fixed
#137Pin from local file not workingโœ… Fixed
#136Pin and delete function not workingโœ… Fixed
#130Story pin creationโœ… Fixed
#108Login broken (API updates)โœ… Fixed
</details>

๐Ÿ“ฆ Installation

bash
pip install py3-pinterest

Requirements: Python 3.8+ ย ยทย  Google Chrome (for login only)


โšก Quick Start

python
from py3pin.Pinterest import Pinterest pinterest = Pinterest( email='you@email.com', password='your_password', username='your_username', cred_root='cred_root' # cookies stored here, created automatically ) # Login once โ€” cookies are saved and reused automatically (~15 days) pinterest.login() # Pin an image pinterest.pin( board_id='123456789', image_url='https://example.com/image.jpg', title='My Pin', description='Pinned with py3-pinterest' )

๐ŸŽฌ Upload Pins

Image from local file

python
pinterest.upload_pin( board_id='123456789', image_file='photo.jpg', title='My Pin', description='Uploaded with py3-pinterest', link='https://example.com' )

Video pin โœจ

python
pinterest.upload_video_pin( board_id='123456789', video_file='video.mov', title='My Video Pin', description='Video uploaded with py3-pinterest', link='https://example.com' )

๐Ÿ’ก Requires ffmpeg and ffprobe on PATH. Or provide duration_ms, width, height, and cover_image_file manually to skip the dependency.

Pin from URL

python
pinterest.pin( board_id='123456789', image_url='https://example.com/image.jpg', title='Pin Title', description='Pin description' )

Repin

python
pinterest.repin(board_id='board_id', pin_id='pin_id')

๐Ÿ“Œ Pin Management

python
pinterest.load_pin(pin_id='pin_id') # Get full pin data pinterest.delete_pin(pin_id='pin_id') # Delete a pin pinterest.get_pinnable_images(url='...') # Get pinnable images from any website

๐Ÿ“‹ Boards

python
# List boards boards = pinterest.boards(username='someone') # One page boards = pinterest.boards_all(username='someone') # All boards # Create & delete pinterest.create_board(name='My Board', description='A new board') pinterest.delete_board(board_id='board_id') # Board feed โ€” all pins in a board pins = pinterest.board_feed(board_id='board_id', reset_bookmark=True) # Recommendations ("More ideas") recs = pinterest.board_recommendations(board_id='board_id', reset_bookmark=True)

Board Sections

python
pinterest.create_board_section(board_id='board_id', section_name='My Section') pinterest.delete_board_section(section_id='section_id') pinterest.get_board_sections(board_id='board_id') # Supports page_size up to 100 pinterest.get_section_pins(section_id='section_id') # Pin directly to a section pinterest.pin(board_id='board_id', section_id='section_id', image_url='...') pinterest.upload_pin(board_id='board_id', section_id='section_id', image_file='...')

๐Ÿ‘ค Users

python
pinterest.get_user_overview(username='someone') pinterest.get_user_pins(username='someone', reset_bookmark=True)

๐Ÿ‘ฅ Follow / Unfollow

python
# Users pinterest.follow_user(user_id='user_id') pinterest.unfollow_user(user_id='user_id') # Boards pinterest.follow_board(board_id='board_id') pinterest.unfollow_board(board_id='board_id') # Get following & followers (batched) following = pinterest.get_following(username='someone', reset_bookmark=True) followers = pinterest.get_user_followers(username='someone', reset_bookmark=True) # Get all at once all_following = pinterest.get_following_all(username='someone') all_followers = pinterest.get_user_followers_all(username='someone')

python
# Scopes: pins, buyable_pins, my_pins, videos, boards results = pinterest.search(scope='pins', query='home decor', reset_bookmark=True)
python
pin_data = pinterest.load_pin(pin_id='pin_id') results = pinterest.visual_search(pin_data, x=10, y=50, w=100, h=100)

Type-ahead

python
pinterest.type_ahead(term='apple')

๐Ÿ’ฌ Comments

python
pinterest.comment(pin_id='pin_id', text='Nice pin!') pinterest.delete_comment(pin_id='pin_id', comment_id='comment_id') pinterest.get_comments(pin_id='pin_id', reset_bookmark=True)

โœ‰๏ธ Messages

python
conversations = pinterest.get_conversations() messages = pinterest.load_conversation(conversation_id='conv_id') # Send text, pin, or both pinterest.send_message(conversation_id='conv_id', message='Hey!') pinterest.send_message(conversation_id='conv_id', pin_id='pin_id') pinterest.send_message(conversation_id='conv_id', pin_id='pin_id', message='Check this out')

๐Ÿ  Home Feed

python
pins = pinterest.home_feed(reset_bookmark=True)

๐Ÿ“– Pagination

Most list methods are batched โ€” they return one page per call. Loop until empty:

python
all_pins = [] batch = pinterest.board_feed(board_id='board_id', reset_bookmark=True) while batch: all_pins += batch batch = pinterest.board_feed(board_id='board_id') print(f'Total: {len(all_pins)} pins')

Always pass reset_bookmark=True on the first call to start fresh.


๐ŸŒ Proxy Support

python
proxies = {"http": "http://user:pass@proxy_ip:port"} pinterest = Pinterest( email='...', password='...', username='...', cred_root='cred_root', proxies=proxies ) pinterest.login(proxy='ip:port')

๐Ÿ” Login & Session

python
pinterest.login() # Headless Chrome pinterest.login(headless=False) # Visible browser (for debugging) pinterest.login(proxy='ip:port') # Through a proxy pinterest.login(lang='en') # Set browser language pinterest.logout()

Cookies persist to disk and are reused across runs. Re-login when you start seeing 401/403 errors (~every 15 days).


๐Ÿงฉ Working with Responses

All methods return the raw Pinterest response:

python
resp = pinterest.upload_pin(board_id='...', image_file='photo.jpg', title='Test') data = resp.json() pin_id = data["resource_response"]["data"]["id"] board_id = data["resource_response"]["data"]["board"]["id"]

๐Ÿ“‚ Examples

Full working examples in the Examples/ directory:

FileDescription
examples.py๐Ÿ—‚๏ธ Comprehensive overview of all features
upload_examples.py๐Ÿ“ค Image and video upload
board_sections_example.py๐Ÿ“‚ Board sections and section pins
download_board_images.pyโฌ‡๏ธ Download all images from boards
follow_examples.py๐Ÿ‘ฅ Search, follow users and boards
mass_board_invites.py๐Ÿ“จ Bulk board invites from search
messages_example.pyโœ‰๏ธ Conversations and messaging
get_board_followers.py๐Ÿ‘ค Get board followers

๐Ÿค Contributing

Found a bug or want to add a feature? Open an issue or submit a PR.

Thanks to all contributors:
@alglez, @anonymustard, @Ashad001, @bahrmichaelj, @CapofWeird, @edersonff, @elmissouri16, @erenalpt, @evezus, @fratamico, @Gmanicus, @imgVOID, @kruvatz, @magicaltoast, @marcosfelt, @mfhassan22, @Nviard, @RKuttruff, @VeemPees, @victorviro, @vladradishevsky, @vriadlee, @vtni, @yaonur

๐Ÿ“š Community Guides


<p align="center"> <b>MIT License</b> ยท Made with โค๏ธ by <a href="https://github.com/bstoilov">@bstoilov</a> </p>

Contributors

Showing top 12 contributors by commit count.

View all contributors on GitHub โ†’

This article is auto-generated from bstoilov/py3-pinterest via the GitHub API.Last fetched: 6/28/2026