This PHP library will help you to work with your Pinterest account without using any API account credentials.
There is a lot of pain using Pinterest API: to get an access to it you need to go to register a developer account, then register your application, then wait for confirmation, and only then you will get an access token. Furthermore, the public API is very poor and has a very limited set of features.
With this library you have the entire set of functions, which available on Pinterest website. And there is no need to register an application to receive an access token. Just use your account login and password, like you do it in your browser. But even your account is not required, if you don't use such operations as creating pins, writing comments or sending messages!
- Installation
- Quick Start
- Examples
- Account
- Boards
- Pins
- Pinners
- Interests and topics
- Search
- Inbox
- Keywords
- Errors handling
- Use proxy
- Custom request settings
- Cookies
- Pagination
Library requires CURL extension and PHP 5.5.9 or above.
The recommended way to install this library is via Composer. New to Composer?
composer require seregazhuk/pinterest-bot
// You may need to amend this path to locate Composer's autoloader
require('vendor/autoload.php');
use seregazhuk\PinterestBot\Factories\PinterestBot;
$bot = PinterestBot::create();
// Login
$bot->auth->login('mypinterestlogin', 'mypinterestpassword');
// Get lists of your boards
$boards = $bot->boards->forUser('yourUserName');
// Create a pin
$bot->pins->create('http://exmaple.com/image.jpg', $boards[0]['id'], 'Pin description');
Note: Some methods use pinterest navigation through results (with bookmarks), for example, get user followers/following, pins likes/dislikes, search and other feed queries. This means that for every batch of results there will be a request to Pinterest. These methods return a Pagination object with Pinterest api results.
How to avoid banned from Pinterest: don't bee too aggressive making pins or writing comments.
Try to put some timeouts with $bot->wait($seconds)
calls, so you will behave like a real person and not a bot,
creating hundreds of pins in a minute.
Here you can find articles with some examples of the most common tasks that can be done with the bot:
- Automate pinning (source code)
- Multiple Accounts and Proxy (source code)
- Comments, Likes And Repins (source code)
- Followers (source code)
- Parsing Pins (source code)
Why not star the GitHub repo? I'd love the attention! And you can donate project on PayPal.
Thanks!