I'm studying the wikipedia API,
some demo api call
What is the pageid? How do I change it into a real page url?
I mean <page pageid="18630637" ns="0" title="Translation" />
, how to change 18630637
into http://en.wikipedia.org/wiki/Translation
?
English Wikipedia's URLs begin https://en.wikipedia.org/. That address on its own is redirected to the Main Page. The main form of a URL to a Wikipedia page: https://en.wikipedia.org/wiki/Page_name (used in wikilinks, recommended when a URL has to be given)
Open the wiki page that you want to rename. Then select its name in the top left of the wiki. A textbox will appear in which you can edit the page title. Click the green checkmark to update the name.
A web-based free encyclopedia, Wikipedia is available in many languages and is among the top 5 websites on the internet. The largest general reference body of work on the internet, its uses in applications offer countless possibilities.
You can just use a URL like this:
http://en.wikipedia.org/?curid=18630637
This is the shortest form, others are also possible:
http://en.wikipedia.org/wiki?curid=18630637
http://en.wikipedia.org/wiki/Translation?curid=18630637
http://en.wikipedia.org/w/index.php?curid=18630637
Note that MediaWiki ignores the page title if you specify a curid, so even
http://en.wikipedia.org/wiki/FooBar?curid=18630637
leads to the same page.
The pageid
is the MediaWiki's internal article ID. You can use the action API's info
property to get the full URL from pageid
:
https://en.wikipedia.org/w/api.php?action=query&prop=info&pageids=18630637&inprop=url
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With