gpt4 book ai didi

Facebook 如何使用 Graph API 获取实际照片 URL?

转载 作者:行者123 更新时间:2023-11-30 05:16:17 24 4
gpt4 key购买 nike

可以使用 Graph api 获取 Facebook 图片的实际图片 url 吗??

例如,对于下面的照片 http://www.facebook.com/photo.php?fbid=357755307655174

实际网址是 https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-ash4/252428_530045532341_5136_n.jpg

是否有一些图形 API 方法可以实现这一点?

最佳答案

By default, not all fields in a node or edge are returned when you make a query. You can choose the fields or edges that you want returned with the fields query parameter.

这就是为什么当您检索照片时,您可能只会得到 created_timenameid

source 字段在最新的 API (v2.8) 中已弃用。请改用 images

因此您的查询可能如下所示:

GET graph.facebook.com/{photo-id}?fields=images

响应应该是这样的:

{

"images":[
{
"height":358,
"source":"https://scontent.xx.fbcdn.net/v/t1.0-9/15327427_585435148333529_xxxxxxxxxxxx_n.jpg?oh=xxxxxxxx&oe=xxxxxxxxx",
"width":518
},
{
"height":320,
"source":"https://fb-s-c-a.akamaihd.net/h-ak-xtl1/v/t1.0-0/p320x320/15327427_xxxxxxxxxxxxxx_n.jpg?oh=xxxxxxxxxx&oe=xxxx&__gda__=xxxxxxxxxxxx",
"width":463
},
{
"height":130,
"source":"https://fb-s-c-a.akamaihd.net/h-ak-xtl1/v/t1.0-0/p130x130/15327427_xxxxxxxxxxxxxx_n.jpg?oh=xxxxxxxxxxx&oe=xxx&__gda__=xxxxxxxxxxxxxxxxxx",
"width":188
},
{
"height":225,
"source":"https://fb-s-c-a.akamaihd.net/h-ak-xtl1/v/t1.0-0/p75x225/15327427_xxxxxxxxxxxxxxx_n.jpg?oh=xxxxxxxxxxxxxxxxx&oe=xxxxxxxxxxxxxxxxxx&__gda__=xxxxxxxxxxxxxxxxxx",
"width":325
}
],
"id":"585435148333529"

}

关于Facebook 如何使用 Graph API 获取实际照片 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14243464/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com