Skip to main content

Unofficial pinterest api implemented in python 3

Project description

py3-pinterest

Unofficial Pinterest API implemented in python 3 that can do almost all pinterest tasks like comment, pin, repin, follow, unfollow and more. It is implemented by directly calling the pinterest servers, mimicking an actual browser, so you don't need pinterest API key.

If you see any issues, or find bugs feel free to report them here on the github repo.

Install using pip

pip install py3-pinterest

Functionalities

For working code examples see examples.py

Create new instance of the API

pinterest = Pinterest(email='your email goes here', password='password goes here', username='look in pinterest url', cred_root='cred root dir')

cred_root is the dir (automatically created if missing) that will store some cookies nad sessions, so you don't need to login before each request. Make sure you specify a path with read/write persmissions.

Login

pinterest.login()

Logs you in and stores the cookies needed for further requests. Pinterest session have several hours before they expire, if inacitve. If you keep making requests you will keep the session alive and you might not need to login, if you receive unauthorized error on api call, then you need to call this method. Keep in mind that too much login request might lock your account.

Load profile

user_overview = pinterest.get_user_overview()

Get boards

board_batch = pinterest.boards(username='username')

If username is left blank, current logged in user will be used.

Get board pins

board_batch = pinterest.boards()

Delete pin

pinterest.delete_pin(pin_id='pin_id')

If there is no such pin 404 Not found is thrown If you don't have permissions to delete is 403 Forbidden is thrown.

Follow

pinterest.follow_user(user_id='target_user_id', username='target_username')

Follow limit is 300 per day, after that they might place you on watch list

Unfollow

pinterest.unfollow_user(user_id='target_user_id', username='target_username')

Unfollow limit is 350 per day, after that they might place you on watch list

Get following

following_batch = pinterest.get_following(username='some_user')

If username is not provided current user will be used

Get followers

followers_batch=pinterest.get_user_followers(username='some_user')

If username is not provided current user will be used

Get home feed pins

home_feed_batch = pinterest.home_feed()

Get board recommendations (this is the 'more ideas' api)

rec_batch = pinterest.board_recommendations(board_url=board_url, board_id=board_id)

Repin

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

Get pinnable images

pinterest.get_pinnable_images(url='https://www.tumblr.com/search/food')

Pin

pinterest.pin(board_id=board_id, image_url=image_url, description=description, title=title)

Search

search_batch = pinterest.search(scope='boards', query='food')

Current pinterest scopes are: pins, buyable_pins, my_pins, videos, users, boards

Follow board

pinterest.follow_board(board_url=board_url, board_id=board_id)

Unfollow board

pinterest.unfollow_board(board_url=board_url, board_id=board_id)

Invite to board

pinterest.invite(board_id=board_id, board_url=board_url, user_id=target_user_id)

Delete board invite

pinterest.delete_invite(board_id=board_id, board_url=board_url, invited_user_id=target_user_id)

Get board invites

invites_batch = pinterest.get_board_invites(board_url=board_url, board_id=board_id)

Comment

pinterest.comment(pin_id=pin_id, text=comment_text)

Delete comment

pinterest.delete_comment(pin_id=pin_id, comment_id=comment_id)

Get Pin comments

pinterest.get_comments(pin_id='pin_id')

Get pin by id

pinterest.load_pin(pin_id='pin_id')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py3-pinterest-0.1.6.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py3_pinterest-0.1.6-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file py3-pinterest-0.1.6.tar.gz.

File metadata

  • Download URL: py3-pinterest-0.1.6.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.2

File hashes

Hashes for py3-pinterest-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ba101e5982d0c4a81d7e9689f79887de23e9c75b751074f10b0bd1b3c1c0911a
MD5 1ba1487a2cf688c29ba429c0c7771bef
BLAKE2b-256 efdaf7b4c6960289c6fe955ced5f66cf7c523c9c7efc0edb88bac34122e513c0

See more details on using hashes here.

File details

Details for the file py3_pinterest-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: py3_pinterest-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.5.2

File hashes

Hashes for py3_pinterest-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8844b9721453c7a99e628fd96c8a3efbc8144e94040dabdd01b03adba4beec4d
MD5 8b3f7f8b2782b2280a1d5ab14581b67b
BLAKE2b-256 518405179008ce5183e3e0e668d3746a4a0bfc7716af5d541612a9664bd9b8d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page