Pinterest API客户端

pinterest-api的Python项目详细描述


Python Pinterest API

license MITpython 3.6 | 3.7

开始

pip install pinterest-api

用法

importpinterest# Generate OAuth2 authorization linklink=pinterest.oauth2.authorization_url(app_id,redirect_uri)# Initialize API by passing OAuth2 tokenapi=pinterest.Pinterest(token="ApFF9WBrjug_xhJPsETri2jp9pxgFVQfZNayykxFOjJQhWAw")# Fetch authenticated user's dataapi.me()# Fetch authenticated user's boardsapi.boards()# Create boardapi.board().create("Halloween",description="Fun Costumes")# Fetch boardapi.board("695665542379607495").fetch()api.board("username/halloween").fetch()# Fetch pins on boardapi.board("username/halloween").pins()# Edit boardapi.board("username/halloween").edit(new_name="Costumes",new_description="Halloween Costume Ideas")# Delete boardapi.board("username/halloween").delete()# Fetch board suggestionsapi.suggest_boards(pin=162129655315312286)# Fetch authenticated user's pinsapi.pins()# Create a pinapi.pin().create(board,note,link,image_url=image_url)# Fetch a pinapi.pin(162129655315312286).fetch()# Edit a pinapi.pin(162129655315312286).edit(board,note,link)# Delete a pinapi.pin(162129655315312286).delete()# Search boards (Optional cursor)api.search_boards(query,cursor=None)# Search pins (Optional cursor)api.search_pins(query,cursor=None)# Follow a boardapi.follow_board(board)# Follow a userapi.follow_user(username)# Return the users who follow the authenticated userapi.followers(cursor=None)# Return the boards that the authenticated user followsapi.following_boards(cursor=None)# Return the topics the authenticated user followsapi.following_interests(cursor=None)# Return the users the authenticated user followsapi.following_users(cursor=None)# Unfollow boardapi.unfollow_board(board)# Make authenticated user unfollow userapi.unfollow_user(username)# Fetch another user's infoapi.user(username)# Fetch board sectionsapi.board("695665542379586148").sections()# Create board sectionapi.board("695665542379586148").section("Section Title").create()# Delete board sectionapi.board("695665542379586148").section("4989415010584246390").delete()# Fetch pins in board sectionapi.board("695665542379586148").section("4989343507360527350").pins()

响应

pinterest api响应是json格式的。

api.me()# By default, retry http request up to 3 times
{"data":{"first_name":"Bryan","id":"695665611098925391","last_name":"Andrade","url': "https://www.pinterest.com/bandrade1815/"},"ratelimit":{"limit":10,"remaining":9}}

资源

Pinterest Developer API
Pinterest API Explorer

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何修改打印板?   java Spring批处理JdbcCursorItemReader还是RepositoryItemReader?   java如何在JTable Swing中增加标题列的字体?   java在数组方面遇到问题,导致表达式非法启动   java如何为maven pom的某些部分关闭Eclipse代码格式化程序。xml   java Dropwizard登录代码   java Jersey 2.22:客户端的默认连接超时是多少?   java无法自动连接字段:javax。sql。数据来源   如何从java中的行列表中获取单词列表?   java JDBC批量更新和处理异常?   计算大根:bigdecimal/java   java如何在JavaCC语法中提到trycatch块   javasocket。getInetAddress()不返回任何内容   oracle SQL开发人员错误无法找到Java虚拟机   java我如何计算和显示未来5年每一年的投资价值   java如何关闭浏览器选项卡?   java如何在showMessageDialog中打印双2D数组?   java从站点抓取播放列表URL?   selenium中的java点击css按钮