Knight
Knight

Reputation: 223

Get the Wikipedia topic title from curid

I have Wikipedia pages specified as : I can parse the curid and use it to get specific Wiki pages.

Question: How can I get the Wikipedia topic title using this curid? I am trying as follows when the curid=37274 and the page is about "Wall Street". I want to extract this "Wall Street" given the page_id : http://en.wikipedia.org/w/api.php?action=query&pageids=37274&format=xml

I can parse the output of this query. But is there any easier way to obtain this? BTW, I use Java..

Thanks

Upvotes: 2

Views: 1668

Answers (1)

Ilmari Karonen
Ilmari Karonen

Reputation: 50328

I don't know of any easier way to do that. Perhaps it might help if you told us what in particular you find inconvenient about that method.

If you don't like parsing XML, you can get the result in several other formats, including JSON.

Also, just to be sure, you do know that you can resolve multiple page IDs with one query, right?

Upvotes: 2

Related Questions