1

I have a list of author names in a .csv and want to find where each author was born. I know you can use the wikipedia api to get information and wikidata is a thing - but I am not sure what query to use or how to get my head around the documentation.

Does anyone have any helpful links which are good at explaining the data or have a way of identifying that the name is from an author in the JSON call and to get the birth location back from this?

I'm sorry this question is slightly vague - I'm not quite sure where to start.

Jess
  • 243
  • 1
  • 2
  • 11
  • What have you tried, where are you stuck? Stuck even getting started>? – Austin T French Jul 18 '17 at 17:41
  • Say if I wanted Enid Blyton's data I could use: 'https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&titles=Enid_Blyton' But this doesn't give me where she was born, which is the only data I need and if there was another person called Enid Blyton who isn't an author it might come up with them instead? So it would be helpful if there was a way to clarify this. – Jess Jul 19 '17 at 08:28
  • Does this answer your question? [get birthdate, birthplace from mediawiki xml format api](https://stackoverflow.com/questions/17854633/get-birthdate-birthplace-from-mediawiki-xml-format-api) – Pat Myron Jun 02 '23 at 17:08

2 Answers2

1

How to extract information from a Wikipedia infobox? 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 for example:

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". }
}
Tgr
  • 27,442
  • 12
  • 81
  • 118
0

I had a look for Blyton on wikidata but didn't see a birthplace, or at least not information as precise as that available on wikipedia. However, this answer at https://stackoverflow.com/a/13848631/131187 might be useful to you although I'm not confident of that because what's available in infoboxes varies considerably.

You can try it for Blyton: https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=xmlfm&titles=Enid%20Blyton&rvsection=0

Once you've issued the request you would still need to parse the stuff that comes back in the infobox.

Also, you haven't said what facilities you would be using to drive your search: PHP, Python, Java, something else?

Bill Bell
  • 21,021
  • 5
  • 43
  • 58