I want to get the first paragraph of a Wikipedia article.
What is the API query to do so?
See this section in the MediaWiki documentation.
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§ion=0&prop=text&page=pizza
Note that you'll have to strip out any templates or infoboxes.
1.4m articles
1.4m replys
5 comments
57.0k users