Wikipedia API. How to get URL for results?

Wikipedia API. How to get URL for results?
0

#1

It took me 2 days, but at last ive got the point how to make the request to wikipedia. So now i have the app, that gives me the list of 10 results, BUT, i dont understand how to get URL for each of results, so the user could click on one of the results and get to wikipedia to read the article. Please! Need help!


#2

What do the results contain? Is there a url?

The Wikipedia API documentation is extremely thorough.


#3

All Wikipedia entry links are https://<<locale>>.wikipedia.org/wiki/<<article title>>.

For instance, let’s say your user searches for “dog”. Their locale is en (English). So, you can build the link thusly: https://en.wikipedia.org/wiki/Dog. If the article title has spaces in it, you will need to replace those with underscores.


#4

Results contain the title of an article and a content snippet. But i still did not found how to get the url of each article in json data. But i thought about article id instead. I mean, that it is possible to get to the wikipedia page of each link using the id, that comes in json. I`ll try this way when get to computer. Thank u anyway!


#5

Thank you mate! I`ll look for how to make this work.