API:Alllinks
From MediaWiki.org
| This page is part of the MediaWiki API documentation. |
Quick overview:
- Quick start guide
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Search suggestions
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| MediaWiki version: | 1.11 |
Returns a list of (unique) links to pages in a given namespace starting ordered by link title.
Parameters[edit | edit source]
alcontinue: Used to continue a previous requestalfrom: Start listing at this title. The title need not exist.alprefix: 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 enumerated.alunique: If set, multiple links to the same title will be listed only once. It cannot be used withalprop=ids. When used as a generator, yields target pages instead of source pages. Before MW 1.21 (gerrit:40559) it couldn't be used in generator mode.allimit: Maximum amount of links to list. (Default: 10)alprop: Which properties to return. (Default:title)ids: Page IDs of the linking pages. Cannot be used together withalunique.title: Link titles
Example[edit | edit source]
List all links to talk pages whose name starts with Talk:API
| Result |
|---|
<?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> |
Error Codes[edit | edit source]
| Code | Info |
|---|---|
| alparams | alllinks cannot be used as a generator in unique links mode |
| alparams | alllinks cannot return corresponding page ids in unique links mode Note: This happens when you use alunique and alprop=ids together |
| alparams | alcontinue and alfrom cannot be used together |