How to obtain a list of titles of all Wikipedia articles

The allpages API module allows you to do just that. Its limit (when you set aplimit=max) is 500, so to query all 4.5M articles, you would need about 9000 requests. But a dump is a better choice, because there are many different dumps, including all-titles-in-ns0 which, as its name suggests, contains exactly what you want … Read more

How to use wikipedia api if it exists? [closed]

You really really need to spend some time reading the documentation, as this took me a moment to look and click on the link to fix it. :/ but out of sympathy i’ll provide you a link that maybe you can learn to use. http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=New_York_Yankees&rvprop=timestamp|user|comment|content That’s the variabled you will be looking to get. Your … Read more

How can I get Wikipedia content using Wikipedia’s API?

See this section in the MediaWiki API documentation, specifically involving getting the contents of the page. use the sandbox to test the API call. These are the key parameters. prop=revisions&rvprop=content&rvsection=0 rvsection = 0 specifies to only return the lead section. See this example. http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&rvsection=0&titles=pizza To get the HTML, you can use similarly use action=parse http://en.wikipedia.org/w/api.php?action=parse&section=0&prop=text&page=pizza … Read more

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

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.

Is there a Wikipedia API just for retrieve the content summary?

There’s a way to get the entire “introduction section” without any HTML parsing! Similar to AnthonyS’s answer with an additional explaintext parameter, you can get the introduction section text in plain text. Query Getting Stack Overflow’s introduction in plain text: Using the page title: https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&titles=Stack%20Overflow Or use pageids: https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&pageids=21721040 JSON Response (warnings stripped) { “query”: … Read more