简体   繁体   中英

Getting content using wikipedia API

How can I get the entire first section/paragraph of a Wikipedia article including the first image with a single request?

What I've tried so far (the following url) returns only a snippet:

http://en.wikipedia.org/w/api.php?format=xml&action=query&list=search&srsearch=camera&srlimit=1

If you're wanting the wikitext, use prop=revisions with rvsection=0 . If you're wanting HTML, you can add rvparse=1 to that query or you can use action=parse .

How can I get the entire first section/paragraph of a Wikipedia article including the first image with a single request?

It's not possible to do that in one request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM