我有一个字符串来搜索“谷歌的创始人”
但它返回
{
"query-continue":{
"search":{
"sroffset":10
}
},
"query":{
"searchinfo":{
"totalhits":14577
},
"search":[
{
"ns":0,
"title":"Lars Rasmussen (software developer)"
},
{
"ns":0,
"title":"Wirth's law"
},
{
"ns":0,
"title":"Brin"
},
{
"ns":0,
"title":"H\u00e9ctor Garc\u00eda-Molina"
},
{
"ns":0,
"title":"Chris Wetherell"
},
{
"ns":0,
"title":"Forbes list of The World's Most Powerful People"
},
{
"ns":0,
"title":"Tamil American"
},
{
"ns":0,
"title":"Lars Rasmussen"
},
{
"ns":0,
"title":"List of Jewish American computer scientists"
},
{
"ns":0,
"title":"Larry"
}
]
}
}
但我只想要这两个真正的结果:
{
"ns":0,
"title":"Brin"
},
{
"ns":0,
"title":"Larry"
}
答案 0 :(得分:1)
答案 1 :(得分:0)
(1) - https://www.wikidata.org/w/api.php?action=wbsearchentities&search= google &language=en&type=item&format=json
(2) - https://www.wikidata.org/w/api.php?action=wbsearchentities&search= founder &language=en&type=property&format=json
(3) - https://www.wikidata.org/w/api.php?action=wbgetclaims&entity={id of 1st link}&property={id of 2nd link}&format=json
(4) - https://www.wikidata.org/w/api.php?action=wbgetentities&ids={ numeric-id of 3rd link }&languages=en&format=json&props=labels|descriptions|aliases