2016-11-08 43 views
1

目前,我正在开展一项项目,要求我收集名人粉丝数量(来自instagram或脸书)。如何从Google知识获取社交媒体链接

为了得到这个数字,我得
1.名人的Instagram链接
2.名人的Facebook链接
3.发送到Instagram的请求或Facebook的API来获取他们的追随者数量

我有一直在为名人Instagram和Facebook链接的谷歌知识API进行研究。但是我从中得到的东西并不令人满意。 例如,我把在谷歌知识的请求,

https://kgsearch.googleapis.com/v1/entities:search?query=Ariana+Grande&limit=1&indent=1&key={API-CODE} 

,其结果是

{ “@context”:{

“@vocab”: “schema.org/” ,
“goog”: “schema.googleapis.com/”,
“EntitySearchResult”: “goog:EntitySearchResult”,
“detailedDescription”: “goog:detailedDescription”,
“resultScore”: “goog:resultScore”
“公斤”: “g.co/kg”
},
“@type”: “ITEMLIST”
“itemListElement”:[
{
“@type”: “EntitySearchResult”
“结果”:{
“@id”: “公斤:/米/ 09gkdy4”
“名称”: “雅瑞安娜·格兰德”,
“@type” :[
“东西”,
“人”
],
“描述”: “歌手”,
“图像”:{
“的contentURL”: “t0.gstatic.com/images?q=tbn:ANd9GcS3KH3ae6ChLCPLguyQXbLbEXDTNMZ1Sb2LsMx6Vr-pjeuHg5AZ”
“URL” : “da.wikipedia.org/wiki/Ariana_Grande”
“许可证”: “creativecommons.org/licenses/by/2.0”
},
“detailedDescription”:{
“articleBody”:“雅瑞安娜·格兰德布特拉是专业知名的阿丽亚娜格兰德,是美国的歌手和演员。她在百老汇音乐剧13开始了自己的职业生涯,之后于2009年将Cat Valentine的角色登上了Nickelodeon电视系列节目Victorious。“,
”url“:”en.wikipedia.org/wiki/Ariana_Grande“,
” “: “en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License”
},
“URL”: “www.arianagrande.com”
},
“resultScore”:802。862244
}
]
}

有关于她从结果的Instagram或Facebook链接没有任何信息,但如果我们手动搜索在谷歌,它显示在搜索结果她的Instagram和Facebook的链接。

我的问题是:
1.如何从Google知识中获得这些链接?
2.或者有什么更简单的方法可以让我旁边名人的追随者号码? (从2-3种不同的API中获益)

谢谢。
我真的很感激任何评论和帮助。

+0

获取公共信息寻找答案也是如此。你问了一会儿,你有没有得到任何答案? – chips

回答

0

您可以使用wikidata.org。有步骤:

  1. 搜索https://www.wikidata.org/w/api.php?action=wbsearchentities&search=Ariana+Grande&language=en&format=json

    { “searchinfo”:{ “搜索”: “阿丽亚娜重创”}, “搜索”:[{ “ID”: “Q151892”, “concepturi” :“http://www.wikidata.org/entity/Q151892”,“url”:“// www.wikidata.org/wiki/Q151892","title":"Q151892","pageid":153289,"label":"Ariana Grande”,“description”: “美国女演员,歌手,作曲家和舞者”,“匹配”:{“type”:“label”,“language”:“en”,“text”:“Ariana Grande”}}],

  2. 从响应中获得编号Q151892并获得实体https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q151892&format=json&props=claims

有一个很大的回应。您需要索赔清单索赔P2003的值arianagrande。它指的是Instagram的用户名(P2013对于Facebook)

  • https://www.instagram.com/arianagrande/?__a=1

    user: 
    follows: 
        count 
    followed_by: 
        count 
    media: 
        count 
    
  • +0

    我将这封信保存下来,因为我已经被转移到另一个项目,但有一天我会回到这个。谢谢你的回应。 – Windy