Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pinterest API board paging

Can anyone do an (educated) guess as to how paging works with the unreleased Pinterest API ?

For example, this link: https://api.pinterest.com/v3/pidgets/boards/grainedit/cars/pins/ returns the first 50 pins of that specific board. But it contains 101 pins. How do I retrieve page 2 and 3 ?

Since the API is not actually public, I can't look it up but maybe happens to know or can do a good guess.

Thanks

Edit:

I've tried:

https://api.pinterest.com/v3/pidgets/boards/grainedit/cars/pins/page/2/
https://api.pinterest.com/v3/pidgets/boards/grainedit/cars/pins/?page=2
https://api.pinterest.com/v3/pidgets/boards/grainedit/cars/pins/?p=2
https://api.pinterest.com/v3/pidgets/boards/grainedit/cars/pins/?offset=2

Pinterest is based on Django so it probably uses the REST Framework. Any ideas?

like image 822
Christiaan Maks Avatar asked Aug 17 '14 21:08

Christiaan Maks


1 Answers

You can Paginate in the Pinterest API by adding the parameter limit CURLing:

https://api.pinterest.com/v1/boards/anapinskywalker/wanderlust/pins/?
access_token=abcde&
limit=2&
fields=id,link,counts,note

This will return two pins, a second object call page will also be returned.

"page": {
    "cursor":"abcde1234",
    "next":"https://api.pinterest.com/v1/boards/anapinskywalker/wanderlust/pins/?access_token=abcde&fields=id%2Clink%2Ccounts&2Cnote&limit=2&cursor=abcde1234"
}

You can then CURL the next URL to see then next two pins.

like image 128
woodchuck Avatar answered Sep 17 '22 13:09

woodchuck