Chad
Chad

Reputation: 2455

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

Upvotes: 0

Views: 1948

Answers (2)

Anomie
Anomie

Reputation: 94794

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.

Upvotes: 4

hakre
hakre

Reputation: 197757

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.

Upvotes: 0

Related Questions