Wikimedia Developer Support

Data returned by the query API does not say if a link is a red link or not


#1

Hi,

The API mentioned below does not indicate if a link is red (there is no page with that title yet).

https://simple.wikipedia.org/w/api.php?format=json&action=query&prop=revisions&rvslots=*&rvprop=content&titles=west

Is there any way to get this information via the API’s? If not, can this be taken as a feature request?

cheers,
senthil


#2

It seems what you get via this API is the raw, unparsed wikitext. You probably want to try the parse API out (see https://www.mediawiki.org/wiki/API:Parsing_wikitext), or query the titles you are interested in directly.


#3

Are you looking for generator=links?


#4

Thanks @Tgr , generator=links does give the data on which linked titles are missing for a given title.

Is there a way to get the content for the given title and the link information in one single API call?

The below call gives the content for all the titles linked from the “west” title but does not include the content for the “west” title itself.
https://simple.wiktionary.org/w/api.php?format=json&action=query&prop=revisions&rvslots=*&rvprop=content&titles=west&generator=links&gpllimit=max


#5

I don’t think that’s possible.