API:Lists/es
| Esta página es parte de la documentación de la API MediaWiki, pero actualmente está traduciéndose al español. Puedes contribuir traduciéndola, o ir a una versión en alguno de los siguientes idiomas: |
| Idioma: | English • Deutsch • Español • 日本語 • Українська |
|---|
Los listados difieren de las propiedades en dos aspectos. En lugar de agregar datos en los elementos de los elementos pages, cada lista tiene su propia rama separada en el elemento query. Además, la saldia de las listas está limitada por el número de ítems, y puede continuarse usando el elemento query-continue. Salvo que se indique lo contrario, todos los módulos listados en esta página pueden ser usados como generador.
[edit] Límites (limit)
Todas las consultas de listados devuelven un número limitado de resultados. Este límite por defecto es 10, y puede cambiarse hasta 500 para usuarios comunes, o 5000 para usuarios con el permiso apihighlimits (generalmente bots y sysops). Algunos módulos imponen límites más estrictos bajo ciertas condiciones. Si no está seguro de qué límite aplica y quiere la máxima cantidad de resultados posibles, especifique el límite como max. En este caso, devolverá un elemento <limits> especificando el límite usado.
[edit] Errores
Si especificó el límite a un valor más alto que el máximo, se producirá un error como el siguiente:
- code: aplimit
- info: aplimit may not be over 500 (set to 1000) for users
- significado:
aplimitno puede ser superior a 500 (setado en 1000) para usuarios. - notas:
apserá remplazado por el prefijo que le corresponda al módulo, y los números se adecuarán al caso.
[edit] Ejemplo
Obtener la máxima cantidad de revisiones con contenido y backlinks para en:Winnipeg, Manitoba.
<?xml version="1.0" encoding="utf-8"?> <api> <query> <pages> <page pageid="6842860" ns="0" title="Winnipeg, Manitoba"> <revisions> <rev>#REDIRECT [[Winnipeg]] {{R from Canadian settlement name}}</rev> <rev>#REDIRECT [[Winnipeg]]</rev> </revisions> </page> </pages> <backlinks> <bl pageid="924" ns="0" title="A. A. Milne" /> <bl pageid="5959" ns="0" title="Canadian Pacific Railway" /> <!-- ... --> <bl pageid="708754" ns="2" title="User:ChrisErbach" /> <bl pageid="802133" ns="2" title="User:Earl Andrew/54nl) 80X" /> </backlinks> </query> <limits revisions="50" backlinks="500" /> <query-continue> <backlinks blcontinue="0|Winnipeg,_Manitoba|994168" /> </query-continue> </api>
[edit] allpages / ap
| MediaWiki version: | 1.9 |
Returns a list of pages in a given namespace, ordered by page title.
[edit] Parameters
apfrom: Start listing at this title. The title need not existapprefix: Only list titles that start with this valueapnamespace: The namespace to enumerate. You can only enumerate one namespace at a time. By default, the main namespace will be enumeratedapfilterredir: How to filter redirectsall: List all pages regardless of their redirect flag (default)redirects: Only list redirectsnonredirects: Don't list redirects
apfilterlanglinks: How to filter based on whether a page has language linksall: List all pages regardless of whether they have language links (default)withlanglinks: Only list pages with language linkswithoutlanglinks: Only list pages without language links
apminsize: Only list pages that are at least this many bytes in sizeapmaxsize: Only list pages that are at most this many bytes in sizeapprtype: Only list pages that have been protected from this type of actionedit: Only list edit-protected pagesmove: Only list move-protected pages- Other wikis may allow for more kinds of protection and will therefore provide more options here
apprlevel: Only list pages that have been protected at this level. Cannot be used withoutapprtypeautoconfirmed: Only autoconfirmed users can edit/move/whateversysop: Only sysops can edit/move/whatever- Empty: Everyone can edit/move/whatever
- Other wikis may allow protection on more levels and will therefore provide more options here
aplimit: Maximum amount of pages to list (10 by default)apdir: In which direction to listascending: List from A to Z (default)descending: List from Z to A
[edit] Example
Show a list of first 5 pages starting from "Kre"
<api> <query-continue> <allpages apfrom="Kreatel" /> </query-continue> <query> <allpages> <p pageid="1756320" ns="0" title="Kre'fey" /> <p pageid="3361042" ns="0" title="Kreab" /> <p pageid="288613" ns="0" title="Kreacher" /> <p pageid="812540" ns="0" title="Kreamer, PA" /> <p pageid="133750" ns="0" title="Kreamer, Pennsylvania" /> </allpages> </query> </api>
[edit] Possible errors
- code: apparams
- info: Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator
- code: apparams
- info: prlevel may not be used without prtype
[edit] alllinks / al
| MediaWiki version: | 1.11 |
Returns a list of (unique) links to pages in a given namespace starting ordered by link title.
[edit] Parameters
alcontinue: Used to continue a previous requestalfrom: Start listing at this title. The title need not existalprefix: Only list links to titles that begin with this valuealnamespace: The namespace to enumerate. You can only enumerate one namespace at a time. By default, the main namespace will be enumeratedalunique: If set, multiple links to the same title will be listed only once. Cannot be used in generator mode or withalprop=idsallimit: Maximum amount of links to list (10 by default)alprop: Which properties to returnids: Page IDs of the linking pages. Cannot be used together withaluniquetitle: Link titles (default)
[edit] Example
List all links to talk pages whose name starts with Talk:API
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <alllinks alcontinue="APILAS|5484123" /> </query-continue> <query> <alllinks> <l fromid="3633229" ns="1" title="Talk:API" /> <l fromid="14912955" ns="1" title="Talk:API-Calculus" /> <l fromid="15131143" ns="1" title="Talk:API5" /> <l fromid="15165243" ns="1" title="Talk:API5" /> <l fromid="8327984" ns="1" title="Talk:APIIC Tower" /> <l fromid="14109257" ns="1" title="Talk:APIIC Tower" /> <l fromid="14177354" ns="1" title="Talk:APIIC Tower" /> <l fromid="14180196" ns="1" title="Talk:APIIC Tower" /> <l fromid="6760965" ns="1" title="Talk:APIIT" /> <l fromid="12229053" ns="1" title="Talk:APILAS" /> </alllinks> </query> </api>
[edit] Possible errors
- code: alparams
- info: alllinks cannot be used as a generator in unique links mode
- code: alparams
- info: alllinks cannot return corresponding page ids in unique links mode
- This happens when you use
aluniqueandalprop=idstogether
- This happens when you use
- info: alllinks cannot return corresponding page ids in unique links mode
- code: alparams
- info: alcontinue and alfrom cannot be used together
[edit] allcategories / ac
| MediaWiki version: | 1.12 |
Get a list of all categories. This differs from list=allpages&alnamespace=14 in that empty categories aren't listed, and categories without description pages are.
[edit] Parameters
acfrom: Start listing at this category title. The category need not existacprefix: Only list category titles starting with this valueaclimit: Maximum amount of categories to list (10 by default)acdir: In which direction to listascending: List from A to Z (default)descending: List from Z to A
[edit] Example
List the first 10 categories whose name starts with "List of"
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <allcategories acfrom="List of Baptist sub-denominations" /> </query-continue> <query> <allcategories> <c>List of "M" series military vehicles</c> <c>List of Alternative Rock Groups</c> <c>List of Alumni of Philippine Science High School</c> <c>List of American artists</c> <c>List of Anglicans and Episcopalians</c> <c>List of Arizona Reptiles</c> <c>List of Artists by record label</c> <c>List of Australian Anglicans</c> <c>List of Bahá'ís</c> <c>List of Balliol College people</c> </allcategories> </query> </api>
[edit] Possible errors
None
[edit] allusers / au
| MediaWiki version: | 1.11 |
Get a list of registered users, ordered by username. This module cannot be used as a generator.
[edit] Parameters
aufrom: Start listing at this username. The user name need not existauprefix: Only list usernames starting with this valueaugroup: Only list users in this groupbotsysopbureaucrat- Any other group that is defined on the wiki. This is different for every wiki; see the API help or action=paraminfo for a list of possible values
auprop: Which properties to returneditcount: The number of edits the user has madegroups: A list of all groups the user is inregistration: The date and time of the user's registration
aulimit: Number of users to list (10 by default)
[edit] Example
Show a list of first 5 sysops
<api> <query-continue> <allusers aufrom="A Train" /> </query-continue> <query> <allusers> <u name="(aeropagitica)" /> <u name="-- April" /> <u name="17Drew" /> <u name="23skidoo" /> <u name="A Man In Black" /> </allusers> </query> </api>
[edit] Possible errors
None
[edit] allimages / ai
| MediaWiki version: | 1.12 |
Returns a list of all images, ordered by image title.
[edit] Parameters
aifrom: Start listing at this title. The title need not existaiprefix: Only list titles that start with this valueaiminsize: Only list images that are at least this many bytes in sizeaimaxsize: Only list images that are at most this many bytes in sizeailimit: Maximum amount of images to list (10 by default)aidir: In which direction to listascending: List from A to Z (default)descending: List from Z to A
aisha1: Only list images with this SHA-1 hash. These hashes are supposed to be unique, so you can use this to track duplicates. If you run into two different images with the same hash, you should start playing the lotteryaisha1base36: Same asaisha1, but in base 36aiprop: Which properties to gettimestamp: The time and date the most recent version of the image was uploaded (default)user: The name of the user who uploaded the most recent versioncomment: The edit comment for the latest uploadurl: The URL to the most recent version of the image (default)size: The image's size in bytesdimensions: The image's width and height in pixelsmime: The image's MIME typesha1: The image's SHA-1 hashmetadata: Image metadata, if available
[edit] Example
Show a list of first 5 images whose name starts with "Albert"
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <allimages aifrom="Albert-einstein-biography-pictures.jpg" /> </query-continue> <query> <allimages> <img name="Albert's_Real_Jamaican_Foods.JPG" width="1024" height="768" mime="image/jpeg" /> <img name="Albert-Cashier.jpg" width="150" height="220" mime="image/jpeg" /> <img name="Albert-Park-Brisbane-1.jpg" width="936" height="695" mime="image/jpeg" /> <img name="Albert-Park-Brisbane-2.jpg" width="830" height="525" mime="image/jpeg" /> <img name="Albert-Park-railway-station.jpg" width="640" height="480" mime="image/jpeg" /> </allimages> </query> </api>
[edit] backlinks / bl
| MediaWiki version: | 1.9 |
Lists pages that link to a given page, similar to Special:Whatlinkshere. Ordered by linking page title.
[edit] Parameters
bltitle: List pages linking to this title. The title need not existblnamespace: Only list pages in these namespacesblfilterredir: How to filter redirectsall: List all pages regardless of their redirect flag (default)redirects: Only list redirectsnonredirects: Don't list redirects
bllimit: Maximum amount of pages to list (10 by default). Maximum limit is halved ifblredirectis setblredirect: If set, pages linking tobltitlethrough a redirect will also be listed. See below for more detailed informationblcontinue: Used to continue a previous request
[edit] Example
Find all pages that redirect to en:Main Page.
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <backlinks blcontinue="0|Main_Page|668228" /> </query-continue> <query> <backlinks> <bl pageid="217224" ns="0" title="Mainpage" /> <bl pageid="217225" ns="0" title="Main page" /> <bl pageid="234094" ns="0" title="Main Path" /> <bl pageid="485188" ns="4" title="Wikipedia:Main page" /> <bl pageid="485697" ns="0" title="Main Page/" /> </backlinks> </query> </api>
[edit] Links through redirects
| MediaWiki version: | 1.12 |
When the blredirect parameter is set, this module behaves slightly differently. bllimit applies to both levels separately: if e.g. bllimit=10, at most 10 first-level pages (pages that link to bltitle) and 10 second-level pages (pages that link to bltitle through a redirect) will be listed. Continuing queries also works differently, as displayed in the following example.
Get a list of pages linking to Application programming interface
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <backlinks blcontinue="0|Application_programming_interface|1191|42661" /> </query-continue> <query> <backlinks> <bl pageid="1191" ns="0" title="API" redirect=""> <redirlinks> <bl pageid="2807" ns="0" title="Active Directory" /> <bl pageid="4355" ns="0" title="BBC Micro" /> <bl pageid="8146" ns="0" title="DOS" /> <bl pageid="9101" ns="0" title="Device driver" /> <bl pageid="15215" ns="0" title="Internet Explorer" /> <bl pageid="29090" ns="0" title="Software testing" /> <bl pageid="30237" ns="0" title="Tcl" /> <bl pageid="32612" ns="0" title="Virtual reality" /> <bl pageid="34203" ns="0" title="XFS" /> <bl pageid="37545" ns="0" title="Palm OS" /> </redirlinks> </bl> <bl pageid="2141" ns="0" title="Atari ST" /> <bl pageid="2323" ns="0" title="Amdahl's law" /> <bl pageid="2581" ns="0" title="Apache HTTP Server" /> <bl pageid="2753" ns="0" title="AutoCAD" /> <bl pageid="3105" ns="0" title="AmigaOS" /> <bl pageid="3130" ns="0" title="Advanced Power Management" /> <bl pageid="4440" ns="0" title="Berkeley Software Distribution" /> <bl pageid="4473" ns="0" title="BIOS" /> <bl pageid="4706" ns="0" title="Berkeley DB" /> </backlinks> </query> </api>
When continuing this request, we see that there are more pages linking to API, and that the other first-level pages are listed again. To progress beyond Berkeley DB, we have to query-continue again and again until we've had all links to API (or increase bllimit, of course). Continuing the previous request
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <backlinks blcontinue="0|Application_programming_interface|1191|56891" /> </query-continue> <query> <backlinks> <bl pageid="1191" ns="0" title="API" redirect=""> <redirlinks> <bl pageid="42661" ns="0" title="Myth (computer game series)" /> <bl pageid="42750" ns="0" title="Enterprise JavaBean" /> <bl pageid="45308" ns="0" title="XPath" /> <bl pageid="46628" ns="0" title="Automated teller machine" /> <bl pageid="51172" ns="0" title="DNIX" /> <bl pageid="51746" ns="0" title="Cisco Systems" /> <bl pageid="53076" ns="0" title="Darwin (operating system)" /> <bl pageid="53252" ns="0" title="Liberty BASIC" /> <bl pageid="55519" ns="0" title="NeWS" /> <bl pageid="55888" ns="0" title="Trusted system" /> </redirlinks> </bl> <bl pageid="2141" ns="0" title="Atari ST" /> <bl pageid="2323" ns="0" title="Amdahl's law" /> <bl pageid="2581" ns="0" title="Apache HTTP Server" /> <bl pageid="2753" ns="0" title="AutoCAD" /> <bl pageid="3105" ns="0" title="AmigaOS" /> <bl pageid="3130" ns="0" title="Advanced Power Management" /> <bl pageid="4440" ns="0" title="Berkeley Software Distribution" /> <bl pageid="4473" ns="0" title="BIOS" /> <bl pageid="4706" ns="0" title="Berkeley DB" /> </backlinks> </query> </api>
[edit] Possible errors
- code: blbad_title_count
- info: The backlinks query requires one title to start
- This happens when you use
titlesinstead ofbltitle(this usage is deprecated) and specify multiple titles
- This happens when you use
- info: The backlinks query requires one title to start
- code: bl_badcontinue
- info: Invalid continue param. You should pass the original value returned by the previous query
[edit] blocks / bk
| MediaWiki version: | 1.12 |
List all blocks, à la Special:Ipblocklist. This module cannot be used as a generator.
[edit] Parameters
bkstart: The timestamp to start listing frombkend: The timestamp to end listing atbkdir: Direction to list in.older: List newest blocks first (default). Note: bkstart has to be later than bkend.newer: List oldest blocks first. Note: bkstart has to be before bkend.
bkids: Only list blocks with these IDsbkusers: Only list blocks of these usersbklimit: Maximum number of blocks to list (10 by default)bkprop: A pipe-separated list of properties to get. The default value is id|user|by|timestamp|expiry|reason|flagsid: The ID of the block (default)user: The IP address or username that was blocked (default)by: The user who applied the block (default)timestamp: When the block was applied (default)expiry: When the block will expire (default)reason: The reason for the block (default)range: If an IP range was blocked, the first and last IP the block applies toflags: Flags that apply to the block (default)automatic: Automatically blocked because of an autoblock (see also action=block)anononly: Only anonymous edits are blockednocreate: Account creation is disabledautoblock: Automatic blocking is enabled for this blocknoemail: Sending e-mail through the wiki is disabled for the blocked userhidden: This block is hidden from Special:Ipblocklist. Only users with oversight permissions can see these blocks.
[edit] Example
Listing the 3 most recent blocks
<?xml version="1.0" encoding="utf-8"?> <api> <query> <blocks> <block id="4" user="123.123.0.0/16" userid="0" by="Catrope" byuserid="1" timestamp="2007-11-23T11:44:41Z" expiry="infinity" reason="Bad proxies; these folks will just have to register" rangestart="123.123.0.0" rangeend="123.123.255.255" anononly="" /> <block id="2" user="25.50.100.200" userid="0" by="Catrope" byuserid="1" timestamp="2007-11-23T11:37:28Z" expiry="infinity" reason="Intimidating behaviour/harassment" rangestart="25.50.100.200" rangeend="25.50.100.200" anononly="" nocreate="" /> <block id="1" user="Vandal01" userid="3" by="Catrope" byuserid="1" timestamp="2007-11-23T11:36:40Z" expiry="2007-12-23T11:36:40Z" reason="Spamming links to external sites" rangestart="0.0.0.0" rangeend="0.0.0.0" nocreate="" autoblock="" noemail="" /> </blocks> </query> </api>
[edit] Possible errors
None.
[edit] categorymembers / cm
| MediaWiki version: | 1.11 |
List of pages that belong to a given category, ordered by page sort title.
[edit] Parameters
cmtitle: The category to enumeratecmnamespace: Only list pages in these namespacescmstart: Start listing at this timestamp. Can only be used withcmsort=timestampcmend: End listing at this timestamp. Can only be used withcmsort=timestampcmsort: Property to sort bysortkey: The article's sort key (default)timestamp: The time the article was added to the category
cmdir: Direction to sort inasc: From A to Z or from 2002 to 2012. Note: cmstart has to be before cmenddesc: From Z to A or from 2012 to 2002 Note: cmstart has to be later than cmend
cmlimit: Maximum amount of pages to list (10 by default)cmprop: Which properties to getids: page ID (default)title: page title (default)sortkey: sort keytimestamp: time and date the article was added to the category
cmcontinue: Used to continue a previous request
[edit] Example
Get the 10 articles most recently added to Category:Physics
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <categorymembers cmcontinue="Magnetic levitation|" /> </query-continue> <query> <categorymembers> <cm pageid="1653925" ns="100" title="Portal:Physics" /> <cm pageid="22939" ns="0" title="Physics" /> <cm pageid="3445246" ns="0" title="Glossary of classical physics" /> <cm pageid="25856" ns="0" title="Radiation" /> <cm pageid="16212316" ns="14" title="Category:Gravitation" /> <cm pageid="24489" ns="0" title="List of basic physics topics" /> <cm pageid="4412382" ns="0" title="Friability" /> <cm pageid="1111581" ns="0" title="Reaction (physics)" /> <cm pageid="16178400" ns="0" title="Normal (optics)" /> <cm pageid="14476384" ns="0" title="Mass versus weight" /> </categorymembers> </query> </api>
[edit] Possible errors
- code: cmnotitle
- info: The cmtitle parameter is required
- code: cminvalidcategory
- info: The category name you entered is not valid
- code: cmbadcontinue
- info: Invalid continue param. You should pass the original value returned by the previous query
[edit] embeddedin / ei
| MediaWiki version: | 1.9 |
List pages that include a certain page.
[edit] Parameters
eititle: List pages including this title. The title need not existeinamespace: Only list pages in these namespaceseifilterredir: How to filter redirectsall: List all pages regardless of their redirect flag (default)redirects: Only list redirectsnonredirects: Don't list redirects
eilimit: Maximum amount of pages to list (10 by default)eicontinue: Used to continue a previous request
[edit] Example
Find all pages that embed en:template:Stub.
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <embeddedin eicontinue="10|Stub|16324457" /> </query-continue> <query> <embeddedin> <ei pageid="7997510" ns="0" title="Maike Evers" /> <ei pageid="10357370" ns="0" title="ConnectU" /> <ei pageid="11347592" ns="0" title="Oliver B. Greene" /> <ei pageid="11886644" ns="0" title="Godfrey Burley Group" /> <ei pageid="14882500" ns="0" title="Contra principia negantem disputari non potest" /> </embeddedin> </query> </api>
[edit] Possible errors
- code: eibad_title_count
- info: The embeddedin query requires one title to start
- This happens when you use
titlesinstead ofeititle(this usage is deprecated) and specify multiple titles
- This happens when you use
- info: The embeddedin query requires one title to start
- code: ei_badcontinue
- info: Invalid continue param. You should pass the original value returned by the previous query
[edit] exturlusage / eu
| MediaWiki version: | 1.11 |
Get a list of pages that link to a certain URL, à la Special:Linksearch
[edit] Parameters
euquery: The URL to search for, without the protocol.*can be used as a wildcard. If you leave this empty, all external links will be listed, andeuprotocolwill be ignoredeuprotocol: Protocol of the URL- The options for this parameter vary per wiki. By default, the options are
http(default),https,ftp,irc,gopher,telnet,nntp,worldwind,mailto,news
- The options for this parameter vary per wiki. By default, the options are
eunamespace: Only list links from pages in these namespaceseulimit: Maximum amount of pages to list (10 by default)euprop: Which properties to getids: Page ID of the linking pagetitle: Title of the linking pageurl: URL being linked to
euoffset: Used for continuing a previous request
[edit] Example
Get a list of pages linking to slashdot.org
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <exturlusage euoffset="11" /> </query-continue> <query> <exturlusage> <eu pageid="533948" ns="2" title="User:Peter Ellis" url="http://slashdot.org" /> <eu pageid="3274" ns="2" title="User:Alexdb" url="http://slashdot.org/" /> <eu pageid="36471" ns="2" title="User:Joao" url="http://slashdot.org/" /> <eu pageid="246276" ns="2" title="User:Pablo Mayrgundter" url="http://slashdot.org/" /> <eu pageid="352958" ns="2" title="User:Yckoh" url="http://slashdot.org" /> <eu pageid="417592" ns="2" title="User:Geekboy" url="http://slashdot.org" /> <eu pageid="439013" ns="4" title="Wikipedia:Village pump/January 2004 archive 5" url="http://slashdot.org" /> <eu pageid="512464" ns="2" title="User:Vaceituno" url="http://slashdot.org" /> <eu pageid="527793" ns="4" title="Wikipedia:New user log/archive1" url="http://slashdot.org" /> <eu pageid="592017" ns="5" title="Wikipedia talk:Announcements/Archive 1" url="http://slashdot.org/" /> </exturlusage> </query> </api>
[edit] imageusage / iu
| MediaWiki version: | 1.11 |
List of pages that include a given image. Ordered by page title.
[edit] Parameters
iutitle: List pages using this image. The image need not existiunamespace: Only list pages in these namespacesiufilterredir: How to filter redirectsall: List all pages regardless of their redirect flag (default)redirects: Only list redirectsnonredirects: Don't list redirects
iulimit: Maximum amount of pages to list (10 by default)iuredirect: If set, pages linking toiutitlethrough a redirect will also be listed. See the documentation for list=backlinks for more detailed informationiucontinue: Used to continue a previous request
[edit] Example
Find all pages that use Image:Albert Einstein Head.jpg
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <imageusage iucontinue="6|Albert_Einstein_Head.jpg|45864" /> </query-continue> <query> <imageusage> <iu pageid="736" ns="0" title="Albert Einstein" /> <iu pageid="2201" ns="0" title="Aage Niels Bohr" /> <iu pageid="12432" ns="0" title="Genius" /> <iu pageid="14400" ns="0" title="History of science" /> <iu pageid="34523" ns="0" title="Zhu Shijie" /> </imageusage> </query> </api>
[edit] Possible errors
- code: iubad_title_count
- info: The imageusage query requires one title to start
- This happens when you use
titlesinstead ofiutitle(this usage is deprecated) and specify multiple titles
- This happens when you use
- info: The imageusage query requires one title to start
- code: iu_badcontinue
- info: Invalid continue param. You should pass the original value returned by the previous query
- code: iubad_image_title
- info: The title for imageusage query must be an image
[edit] logevents / le
| MediaWiki version: | 1.11 |
Get a list of all logged events, à la Special:Log. This module cannot be used as a generator.
[edit] Parameters
leprop: Which properties to getids: Page ID of the page in question and log ID (default)title: Title of the page in question (default)type: Type of log entry (default)user: User responsible for the log entry (default)timestamp: Time and date the log entry was created (default)comment: Log comment (default)details: Extra information (not present for all log types) (default)
letype: Only list log entries of this typeblockprotectrightsdeleteuploadmoveimportpatrolmerge- Extensions may add other log types
leuser: Only list log entries made by this userletitle: Only list log entries related to this titlelestart: The timestamp to start listing fromleend: The timestamp to end listing atledir: Direction to list inolder: List newest log entries first (default). Note:lestarthas to be later thanleend.newer: List oldest log entries first. Note:lestarthas to be beforeleend.
lelimit: Maximum amount of log entries to list (10 by default)
[edit] Example
List the 3 most recent page moves
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <logevents lestart="2008-03-25T21:26:37Z" /> </query-continue> <query> <logevents> <item logid="0" pageid="16577509" ns="1" title="Talk:Parisii (France)" type="move" action="move" user="QuartierLatin1968" timestamp="2008-03-25T21:31:39Z" comment="It is wrong to use such an anachronistic name."> <move new_ns="1" new_title="Talk:Parisii (Gaul)" /> </item> <item logid="0" pageid="16577508" ns="0" title="Parisii (France)" type="move" action="move" user="QuartierLatin1968" timestamp="2008-03-25T21:31:38Z" comment="It is wrong to use such an anachronistic name."> <move new_ns="0" new_title="Parisii (Gaul)" /> </item> <item logid="0" pageid="16577421" ns="10" title="Template:User Brunei work group" type="move" action="move" user="Black Falcon" timestamp="2008-03-25T21:28:02Z" comment="Has become a full WikiProject"> <move new_ns="10" new_title="Template:User WikiProject Brunei" /> </item> </logevents> </query> </api>
[edit] Possible errors
- code: leparam_user
- info: User name username not found
- code: leparam_title
- info: Bad title value 'title'
- This happens when you set
letitleto an invalid title
- This happens when you set
- info: Bad title value 'title'
[edit] recentchanges / rc
| MediaWiki version: | 1.10 |
Get all recent changes to the wiki, à la Special:Recentchanges. This module cannot be used as a generator.
[edit] Parameters
rcstart: The timestamp to start listing fromrcend: The timestamp to end listing atrcdir: Direction to list inolder: List newest changes first (default). Note:rcstarthas to be later thanrcend.newer: List oldest changes first. Note:rcstarthas to be beforercend.
rclimit: Maximum amount of changes to list (10 by default)rcnamespace: Only list changes in these namespacesrctitles: Only list changes to these titlesrctype: Only list certain types of changesedit: Regular page editsnew: Page creationslog: Log entries
rcshow: Only list items that meet these criteria. Conflicting options (such asminorand!minor) cannot be used togetherminor: Only list minor edits!minor: Don't list minor editsbot: Only list bot edits!bot: Don't list bot editsanon: Only list edits by anonymous users!anon: Only list edits by registered usersredirect: Only list edits to pages that are currently redirects!redirect: Only list edits to pages that currently aren't redirectspatrolled: Only list edits flagged as patrolled. Only available to users with thepatrolright!patrolled: Only list edits not flagged as patrolled. Only available to users with thepatrolright
rcprop: Which properties to getuser: The user who made the changecomment: The edit/log commenttimestamp: The time and date of the change (default)title: The title the change was made to (default)ids: The page ID, revision ID, previous revision ID and RCID (used for patrolling) (default)sizes: The page size before and after the changeredirect: Whether the changed page is currently a redirectpatrolled: Whether the change is patrolled. Only available to users with thepatrolrightflags:new: A new page was createdminor: The change was a minor editbot: The change was a bot edit
[edit] Example
Get the 3 most recent changes with sizes and flags
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <recentchanges rcstart="2008-03-25T22:03:47Z" /> </query-continue> <query> <recentchanges> <rc type="log" ns="-1" title="Special:Log/protect" rcid="205182563" pageid="0" revid="0" old_revid="0" user="Yamla" oldlen="0" newlen="0" /> <rc type="new" ns="0" title="Clasico de Avellaneda" rcid="205182562" pageid="16578364" revid="200906507" old_revid="0" user="Eubot" bot="" new="" oldlen="0" newlen="66" /> <rc type="edit" ns="3" title="User talk:Diligent Terrier" rcid="205182561" pageid="12353452" revid="200906506" old_revid="200863749" user="Basketball110" oldlen="202363" newlen="202761" /> </recentchanges> </query> </api>
[edit] Possible errors
- code: rcshow
- info: Incorrect parameter - mutually exclusive values may not be supplied
- code: rcpermissiondenied
- info: You need the patrol right to request the patrolled flag
[edit] search / sr
| MediaWiki version: | 1.11 |
Search for a string in all articles à la Special:Search
[edit] Parameters
srsearch: The string to search forsrwhat: Where to search intitles: Search in page titles (default) (disabled on Wikimedia wikis, usesrwhat=textinstead)text: Search in page text
srnamespace: Only search in these namespaces. By default, only the main namespace is searchedsrredirects: Also list redirectssrlimit: Maximum amount of pages to list (10 by default)sroffset: Used to continue a previous request
[edit] Example
Show a list of 10 pages that contain the word 'wikipedia'
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <search sroffset="10" /> </query-continue> <query> <search> <p ns="0" title="Wikipedia" /> <p ns="0" title="French Wikipedia" /> <p ns="0" title="German Wikipedia" /> <p ns="0" title="Criticism of Wikipedia" /> <p ns="0" title="2004" /> <p ns="0" title="2005" /> <p ns="0" title="Japanese Wikipedia" /> <p ns="0" title="Spanish Wikipedia" /> <p ns="0" title="History of Wikipedia" /> <p ns="0" title="2007" /> </search> </query> </api>
[edit] Possible errors
- code: srparam-search
- info: empty search string is not allowed
- code: srsearch-titles-disabled
- info: titles search is disabled
- code: srsearch-text-disabled
- info: text search is disabled
[edit] usercontribs / uc
| MediaWiki version: | 1.10 |
Gets a list of contributions made by a given user, ordered by modification time. This module cannot be used as a generator.
[edit] Parameters
ucuser: User to retrieve contributions forucuserprefix: List contributions of all users whose name starts with this string. Overridesucuser- This is useful for getting contributions of IP ranges.
- Note that contributions will be sorted by user first, then by timestamp, when using this option
ucstart: The timestamp to start listing fromucend: The timestamp to end listing atucdir: Direction to list inolder: List newest contributions first (default). Note:ucstarthas to be later thanucend.- If using
ucuserprefix, users will be listed in descending order (Z to A)
- If using
newer: List oldest contributions first. Note:ucstarthas to be beforeucend.- If using
ucuserprefix, users will be listed in ascending order (A to Z)
- If using
uclimit: Maximum amount of contributions to list (10 by default)ucnamespace: Only list contributions in these namespacesucshow: Only list contributions that meet these criteria. Conflicting options (such asminorand!minor) cannot be used togetherminor: Only list minor edits!minor: Don't list minor edits
ucprop: Which properties to getids: Page ID and revision IDtitle: Title of the page that was changedtimestamp: Time and date of the contributioncomment: Edit/log commentflags:new: A new page was createdminor: The change was a minor editbot: The change was a bot edit
[edit] Example
Get the first three contributions by en:User:Catrope
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <usercontribs ucstart="2007-06-11T09:23:57Z" /> </query-continue> <query> <usercontribs> <item user="Catrope" pageid="11650099" revid="136629050" ns="3" title="User talk:Catrope" timestamp="2007-06-07T16:45:30Z" minor="" comment="Creation; directing to BW" /> <item user="Catrope" pageid="11650100" revid="136629120" ns="2" title="User:Catrope" timestamp="2007-06-07T16:45:49Z" new="" minor="" comment="Creation; directing to BW" /> <item user="Catrope" pageid="3383874" revid="136629407" ns="3" title="User talk:Ruud Koot" timestamp="2007-06-07T16:47:09Z" comment="Nested collapsible tables fix" /> </usercontribs> </query> </api>
[edit] Possible errors
- code: ucparam_user
- info: User name username is not valid
- code: ucparam_user
- info: User parameter may not be empty
- code: ucshow
- info: Incorrect parameter - mutually exclusive values may not be supplied
[edit] watchlist / wl
| MediaWiki version: | 1.10 |
Get a list of pages on the current user's watchlist that were changed within the given time period. Ordered by time of the last change of the watched page.
[edit] Parameters
wlstart: The timestamp to start listing fromwlend: The timestamp to end listing atwldir: Direction to list inolder: List most recently changed pages first (default). Note:wlstarthas to be later thanwlend.newer: List least recently changed pages first. Note:wlstarthas to be beforewlend.
wllimit: Maximum amount of pages to list (10 by default)wlnamespace: Only list pages in these namespaceswlallrev: Include multiple revisions to the same page. This parameter cannot be used in generator modewlshow: Only list revisions that meet these criteria. Conflicting options (such asminorand!minor) cannot be used togetherminor: Only list minor edits!minor: Don't list minor editsbot: Only list bot edits!bot: Don't list bot editsanon: Only list edits by anonymous users!anon: Only list edits by registered users
wlprop: Which properties to getuser: The user who made the changecomment: The edit/log commenttimestamp: The time and date of the changetitle: The title the change was made to (default)ids: The page ID, revision ID, previous revision ID and RCID (used for patrolling) (default)sizes: The page size before and after the changepatrol: Whether the change is patrolled. Only available to users with thepatrolrightflags: (default)new: A new page was createdminor: The change was a minor editbot: The change was a bot edit
[edit] Example
Get the current user's watchlist
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <watchlist wlstart="2008-03-04T16:01:48Z" /> </query-continue> <query> <watchlist> <item pageid="16396" revid="176417" ns="0" title="API:Query - Lists" /> <item pageid="25300" revid="176413" ns="1" title="Talk:Summer of Code 2008" /> <item pageid="24947" revid="176089" ns="0" title="Summer of Code 2008" /> <item pageid="16377" revid="174495" ns="0" title="API:Query" /> <item pageid="16393" revid="174239" ns="0" title="API:Query - Meta" minor="" /> <item pageid="16375" revid="174222" ns="0" title="API:Login" /> <item pageid="16391" revid="174216" ns="0" title="API:Data formats" minor="" /> <item pageid="14588" revid="174214" ns="0" title="API" /> <item pageid="18710" revid="173571" ns="1" title="Talk:API:Edit - Create&Edit pages" /> <item pageid="20025" revid="173412" ns="1" title="Talk:API:Query" /> </watchlist> </query> </api>
[edit] Possible errors
- code: wlnotloggedin
- info: You must be logged-in to have a watchlist
- code: wlpatrol
- info: patrol property is not available
- code: wlshow
- info: Incorrect parameter - mutually exclusive values may not be supplied
[edit] deletedrevs / dr
| MediaWiki version: | 1.12 |
List deleted revisions. You need the deletedhistory right to use this module. This module cannot be used as a generator.
[edit] Parameters
drstart: The timestamp to start listing fromdrend: The timestamp to end listing at (optional). If not specified, all revisions later than drstart will be listed.drdir: Direction to list in.older: List newest revisions first (default). Note: drstart has to be later than drend.newer: List oldest revisions first. Note: drstart has to be before drend.
drlimit: Maximum number of revisions to list (10 by default)drprop: Which properties to getrevid: Revision IDuser: User who made the edit (default)comment: Edit comment (default)minor: Whether the edit was minorlen: Revision sizecontent: Revision content. You need theundeleteright to use this optiontoken: Undelete token
[edit] Sample request
Listing the 8 most recent deleted revisions dated September 4, 2007.
<?xml version="1.0" encoding="utf-8"?> <api> <query-continue> <deletedrevs drstart="20070904142729" /> </query-continue> <query> <deletedrevs> <page title="Main Page" ns="0" token="e4c475f13be7824135b4edbebf4140ff+\"> <revisions> <rev timestamp="20070904200804" revid="31" user="Catrope" minor="" len="" /> <rev timestamp="20070904200753" revid="30" user="Catrope" minor="" len="" /> <rev timestamp="20070904193501" revid="29" user="Catrope" minor="" len="568" /> <rev timestamp="20070904193213" revid="28" user="Catrope" minor="" len="470" /> <rev timestamp="20070904193103" revid="27" user="192.168.1.3" len="568" /> <rev timestamp="20070904193048" revid="26" user="192.168.1.3" len="480" /> </revisions> </page> <page title="User:Catrope" ns="2" token="e4c475f13be7824135b4edbebf4140ff+\"> <revisions> <rev timestamp="20070904143938" revid="24" user="Catrope" len="52" /> <rev timestamp="20070904142758" revid="23" user="Catrope" len="37" /> </revisions> </page> </deletedrevs> </query> </api>
[edit] Possible errors
- code: drpermissiondenied
- info: You don't have permission to view deleted revision information
- On most wikis, viewing deleted revisions is restricted to sysops, but other wikis may have stricter rules.
- info: You don't have permission to view deleted revision information
- code: drpermissiondenied
- info: You don't have permission to view deleted revision content
[edit] users / us
| MediaWiki version: | 1.12 |
Get information about a list of users. This module cannot be used as a generator.
[edit] Parameters
ususers: A list of user names to get information forusprop: Which properties to getblockinfo: Whether the user is blocked, by whom and whygroups: All groups the user belongs toeditcount: The number of edits the user has made
[edit] Example
Getting information about a list of users
<?xml version="1.0" encoding="utf-8"?> <api> <query> <users> <user name="1.2.3.4" invalid="" /> <user name="Catrope" editcount="203"> <groups> <g>bot</g> <g>bureaucrat</g> <g>steward</g> <g>sysop</g> <g>trusted</g> </groups> </user> <user name="Vandal01" editcount="1" blockedby="Catrope" blockreason="Intimidating behaviour/harassment" /> <user name="Bob" missing="" /> </users> </query> </api>
[edit] Possible errors
None
[edit] random / rn
| MediaWiki version: | 1.12 |
Get a list of random pages.
Pages are listed in a fixed sequence, only the starting point is random. This means that if, for example, "Main Page" is the first random page on your list, "List of fictional monkeys" will always be second, "List of people on stamps of Vanuatu" third, etc.
[edit] Parameters
rnlimit: Maximum number of pages to return (1 by default)- If the number of pages in the namespace is lower than
rnlimit, you will get fewer pages. You will not get the same page twice.
- If the number of pages in the namespace is lower than
rnnamespace: Only list pages in these namespaces
[edit] Example
Get 5 random pages
<?xml version="1.0" encoding="utf-8"?> <api> <query> <random> <page title="History of Indian Institutes of Technology" ns="0" id="4939430" /> <page title="Talk:International Karate +" ns="1" id="1904217" /> <page title="Selion" ns="0" id="758503" /> <page title="User talk:Yenandzen" ns="3" id="12454962" /> <page title="User talk:66.138.5.211" ns="3" id="9965621" /> </random> </query> </api>
[edit] Possible errors
None