Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use the Wiktionary API for getting pronunciation data? [closed]

I was looking for a way to get the pronunciation of any given word by querying an API of some sort. As Wiktionary comes in handy to find pronunciations of words I was trying to use their API, but how do I get the pronunciation of a specific word?

It seems their API only allows getting the entire Wiki article.

like image 857
baik Avatar asked Feb 02 '23 20:02

baik


1 Answers

Wiktionary doesn't have an API of its own. MediaWiki, the software the Wiktionary runs on does have an API but it is completely unaware of the structure and content of Wiktionary.

The best you can do is use the MediaWiki API to find the wiki page for the word you want, then look at the table of contents. If the table of contents has a language section for the language you want and within that there is a Pronunciation section, then use another API call to get the wikitext of that section which you will have to parse yourself. It may well use or not different templates on different words since Wiktionary is constantly evolving.

There are also mailing lists for Wiktionary and for MediaWiki API.

like image 131
hippietrail Avatar answered Feb 05 '23 15:02

hippietrail