如何使用维基百科获取出生地点 API

How to get birth location using Wikipedia API

我在 .csv 文件中有一个作者姓名列表,我想找到每个作者的出生地。我知道您可以使用维基百科 api 获取信息,而维基数据是一回事 - 但我不确定要使用什么查询或如何了解文档。

有没有人有任何有用的链接可以很好地解释数据,或者有办法在 JSON 调用中识别该名称来自作者并从中获取出生地点?

抱歉,这个问题有点含糊 - 我不太确定从哪里开始。

我在维基数据上查找过布莱顿,但没有看到出生地,或者至少没有像维基百科上那样精确的信息。但是, 上的这个答案可能对您有用,尽管我对此没有信心,因为信息框中可用的内容差异很大。

你可以试试布莱顿:https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=xmlfm&titles=Enid%20Blyton&rvsection=0

发出请求后,您仍然需要解析信息框中返回的内容。

此外,您还没有说明您将使用哪些工具来推动搜索:PHP、Python、Java、其他?

is a pretty complete list of the methods that can be used to get structured data about subjects of Wikipedia articles. Specifically for birth locations of authors, you could try this Wikidata SPARQL query 例如:

SELECT DISTINCT ?item ?itemLabel ?birthLocation ?birthLocationLabel WHERE {
  ?item (wdt:P31|wdt:P101|wdt:P106)/wdt:P279* wd:Q482980 ;
        rdfs:label "Enid Blyton"@en ;
        wdt:P19 ?birthLocation
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}