2

I'm going to ask this by example. Take a look at this media file's page

https://commons.wikimedia.org/wiki/File:Sheerness.ogg

It has a table showing "Author" with a value of "Speaker: The Voice of Hassocks Authors of the article". (I'm only interested in the "The Voice of Hassocks" part but the whole thing would be fine).

Is that author value accessible via the API? Generally speaking I can see how I can get other file info via, e.g.

https://commons.wikimedia.org/w/api.php?action=query&titles=File:Sheerness.ogg&prop=imageinfo&iiprop=timestamp|url|user|metadata|extmetadata&format=json

But looking through the output of that API request, I don't see "The Voice of Hassocks" appearing anywhere. Nor, looking through the API docs, do I see anything else other than metadata and extmetadata that might contain it. Is that "Author" info exposed via the API anywhere?

1 Answer 1

2

This is absolutely in the output of your query.

In the Json output, look in query> pages> 3532106> ImageInfo> 0> extmetadata> Artist> value, and you'll get the following data, that may need some further data cleaning depending on your use case:

> '<p><b>Speaker:</b> <a
> href="//commons.wikimedia.org/wiki/User:The_Voice_of_Hassocks"
> class="mw-redirect" title="User:The Voice of Hassocks">The Voice of
> Hassocks</a><br></p>\n<b><span class="plainlinks"><a rel="nofollow"
> class="external text"
> href="https://xtools.wmflabs.org/articleinfo/en.wikipedia.org/%5B%5Bw%3Aen%3ASheerness%7CSheerness%5D%5D/2008-02-10">Authors
> of the article</a></span></b>'

Depending on what you're after exactly, it may be worth looking into the sibling node Credit> value too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.