I get only top 50 pins at a time using this code
https://api.pinterest.com/v3/pidgets/users/lorihiney/pins/
is there any way to get all pins of a particular user .
I faced this problem too when trying to use the API and it left me pulling my hair out!!
I ended up creating a recursive function using info I found online to get all the child pages of a board, while also pushing the pins to an array.
I first saved all my boards to a MYSQL table, then the pins in another. Saves on API calls and made finding duplicates much easier (that was what I was trying to use it for)!
$pins=array();
function findchildren(&$array, $i){
global $pins;
if (true == $i){return;}
foreach($array as $k=>$v){
array_push($pins, $v['data']);
if(!empty($v['page']['next'])){
$newar = curlfunction($v['page']['next']);
findchildren($newar, false);
}
}
}
So something like:
$board = curlfunction('https://api.pinterest.com/v1/boards/lorihiney/diet/pins/?access_token=xxxxx&limit=100&fields=id,link,counts,note,url,image');
findchildren($board, false);
You'd just need to create the cURL function to get the data!!
My Pinterest account has 31 boards and 1890 pins. Works a treat for me after spending AGES trying to figure it out. Hope that it helps somewhat.
You can't do it using the undocumented widget API. If you use the Official Pinterest API you can have a user log in, and fetch all of their Pins/boards/etc using simple pagination. Easiest way to get started is to check out the API Explorer. The endpoint you're interested in is v1/me/pins/
.
Hope that helps!
Now i am getting all information :
This link will give pin info
https://api.pinterest.com/v1/boards/lorihiney/diet/pins/?access_token=xxxxx&limit=100&fields=id,link,counts,note,url,image
we also get link of next page. 1st hit will give 100 pins the after that it will give link of next page. like this:
https://api.pinterest.com/v1/boards/officialpandora/put-a-ring-on-it/pins/?access_token=XXXXX&fields=id%2Clink%2Ccounts%2Cnote%2Cimage%2Ccreated_at%2Curl&limit=100&cursor=!!!!!!!!!!!!
This link will give the information of board:
https://api.pinterest.com/v1/boards/stars-stars-stars?access_token=XXXXXXX&fields=id,counts
All you need is access token which will you get access token
for further details: pinterest Official Doc