如何从 pinterest 获取所有图钉?仅获得 50 个引脚

how to get all pins from pinterest ? getting only 50 pins

我使用此代码一次只能获得前 50 个图钉

https://api.pinterest.com/v3/pidgets/users/lorihiney/pins/

有什么方法可以获取特定用户的所有 PIN 码。

您无法使用未记录的小部件 API。如果你使用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。您感兴趣的端点是 v1/me/pins/.

希望对您有所帮助!

现在我正在获取所有信息:

此 link 将提供 pin 信息

https://api.pinterest.com/v1/boards/lorihiney/diet/pins/?access_token=xxxxx&limit=100&fields=id,link,counts,note,url,image

我们还得到了下一页的 link。第一次点击将给出 100 个图钉,之后它将给出下一页的 link。像这样:

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=!!!!!!!!!!!!

这个link会给出板的信息:

https://api.pinterest.com/v1/boards/stars-stars-stars?access_token=XXXXXXX&fields=id,counts

您只需要访问令牌即可获得 access token

更多详情: pinterest Official Doc

我在尝试使用 API 时也遇到了这个问题,这让我抓狂!!

我最终使用我在网上找到的信息创建了一个递归函数来获取板的所有子页面,同时还将引脚推送到一个数组。

我首先将我所有的电路板保存到 MYSQL table,然后将引脚保存到另一个。节省 API 调用并使查找重复项变得更加容易(这就是我尝试使用它的目的)!

$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);
       }
    }
 }

所以像这样:

$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);

您只需创建 cURL 函数即可获取数据!!

我的 Pinterest 帐户有 31 个图板和 1890 个图钉。在花了 AGES 试图弄明白之后,这对我来说是一种享受。希望能有所帮助。