Pinterest API board paging
Asked Answered
G

2

9

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?

Gracia answered 17/8, 2014 at 21:52 Comment(3)
did u find the answer?)Tine
Nope, doesn't seem Pinterest wants people to know about their API :(Gracia
I hacked it with frontend backbone collection parsing - put it's non general solution gist.github.com/Timopheym/cc86243ece48e512b4c6Tine
P
1

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.

Princessprinceton answered 28/7, 2017 at 18:0 Comment(0)
F
0

Even if they are using some framework (like DRF) they have a million ways to set up the query structure. If I wanted to reverse-engineer some non-published API that was still open I would either use Wireshark or Fiddler2. Then just start using the website and see what sort of requests are being made, figure out the request pattern and build your own API against your ad-hoc API. Another option is simply watching the Network part of Chrome Developer Tools if you just need a general idea.

Farleigh answered 16/9, 2015 at 14:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.