0

I am currently exploring the Wikipedia API and am trying to understand it a bit more. So I am starting with a Wikidata ID and can find my Wikipedia Title there. I extract the title and am then able to query Wikipedia like e.g. so:

https://en.wikipedia.org/w/api.php?action=query&format=json&titles=Los_Angeles&prop=extracts&exsentences=2&explaintext&exintro

The result would be something like the following:

Los Angeles (US: (listen) lawss AN-jəl-əs; Tongva: Tovaangar; Spanish: Los Ángeles; Spanish for "The Angels"), often spoken and written as its initialism, L.A., is the largest city in California. With a 2020 population of 3,898,747, it is the second-largest city in the United States, after New York City, and the third-largest city in North America, after Mexico City and New York City.

That way I get the extract as a plain string. Good! The problem is, that it still contains "links" or "strange things", because some links/infos are removed. E.g. the pronunciation of the text ist now gone but the link to (listen) to it is still there as plain text.

I would like to display the text of the page in an iOS App as plain text somehow. Is there a way to get that from the wikipedia API or will I have to do my own magic?

Georg
  • 3,664
  • 3
  • 34
  • 75
  • See https://stackoverflow.com/questions/4452102/how-to-get-plain-text-out-of-wikipedia – smartse Oct 10 '21 at 13:20
  • Does this answer your question? [How to get plain text out of Wikipedia](https://stackoverflow.com/questions/4452102/how-to-get-plain-text-out-of-wikipedia) – smartse Oct 12 '21 at 12:56

0 Answers0