Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is wikipedia pageid? how to change it into real page url?

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?

like image 627
yuli chika Avatar asked May 29 '11 13:05

yuli chika


People also ask

How do I find the URL for a Wikipedia page?

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)

How do you change the name of a Wikipedia page?

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.

Is Wikipedia API free?

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.


2 Answers

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.

like image 160
jcsahnwaldt Reinstate Monica Avatar answered Oct 09 '22 07:10

jcsahnwaldt Reinstate Monica


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

like image 21
Matěj G. Avatar answered Oct 09 '22 06:10

Matěj G.