Extension:ProofreadPage/Index pagination API

From mediawiki.org
Jump to navigation Jump to search

The ProofreadPage extension provides access to the pages in an index with the proofreadpagesinindex query module. The API prefix is prppii (ProofreadPage pages in index).

Listing pages in an index[edit]

  • prppiititle the index title
  • prppiilimit the maximum number of pages to return
  • prppiicontinue continuation point
  • prppiiprop properties (default: id|title)
    • title: page title
    • id: page ID
{
	"action": "query",
    "list": "proofreadpagesinindex",
	"format": "json",
    "formatversion": 2,
	"prppiititle": "Index:Sandbox.djvu",
}

Example: https://en.wikisource.org/w/api.php?action=query&format=json&formatversion=2&list=proofreadpagesinindex&prppiititle=Index%3ASandbox.djvu

Response
{
    "batchcomplete": "",
    "continue": {
        "prppiifrom": 101,
        "continue": "-||"
    },
    "query": {
        "proofreadpagesinindex": [
            {
                "number": 1,
                "pageid": 23,
                "title": "Page:Sandbox.djvu/1"
            },
            {
                "number": 2,
                "pageid": 28,
                "title": "Page:Sandbox.djvu/2"
            },
            ....
    }
 }

If more pages are returned than configured with prppiilmit or the API limits in general, use the continue.prppiifrom value as the prppiicontinue value of the next request.

As a generator[edit]

This module can be used as a generator, so it can also provide things like page quality:

{
	"action": "query",
	"format": "json",
	"prop": "proofread",
	"list": "",
	"generator": "proofreadpagesinindex",
	"formatversion": "2",
	"gprppiititle": "Index:Sandbox.djvu"
}

Example: https://en.wikisource.org/w/api.php?action=query&format=json&prop=proofread&list=&generator=proofreadpagesinindex&formatversion=2&gprppiititle=Index%3APeri.djvu

Response
{
    "batchcomplete": true,
    "continue": {
        "gprppiifrom": 101,
        "continue": "gprppiifrom||"
    },
    "query": {
        "pages": [
             {
                "ns": 250,
                "title": "Page:Sandbox.djvu/8",
                "missing": true
            },
            {
                "pageid": 23,
                "ns": 250,
                "title": "Page:Sandbox.djvu/1",
                "proofread": {
                    "quality": 3,
                    "quality_text": "Proofread"
                }
            },
            ...
          ]
      }
}