API:Alllinks
Jump to navigation
Jump to search
| This page is part of the MediaWiki Action API documentation. |
| Please help improve this technical documentation! Take our MediaWiki Action API Technical Documentation User Feedback Survey before 6 January – Note: The survey uses Google Forms. See Privacy Statement – Thanks! |
| Alllinks | ||
|---|---|---|
This module can be used as a Generator. |
||
| Prefix | al | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Returns a list of (unique) links to pages in a given namespace starting ordered by link title.
Parameters[edit]
alcontinue: When more results are available, use this to continue.alfrom: The title of the link to start enumerating from.alto: The title of the link to stop enumerating at.alprefix: Search for all linked titles that begin with this value.alunique: Only show distinct linked titles. 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.alprop: Which pieces of information to include: (Default:title)ids: Page IDs of the linking pages. Cannot be used together withalunique.title: Link titles
alnamespace: The namespace to enumerate. You can only enumerate one namespace at a time. (Default: 0)allimit: How many total items to return. No more than 500 (5000 for bots) allowed. (Default: 10)aldir: The direction in which to list. Possible values:ascending,descending(Default:ascending)
Example[edit]
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]
| 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 |
| The following documentation is the output of Special:ApiHelp/query+alllinks, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
list=alllinks (al)
- This module requires read rights.
- This module can be used as a generator.
- Source: MediaWiki
- License: GPL-2.0-or-later
Enumerate all links that point to a given namespace.
Parameters:
- alcontinue
When more results are available, use this to continue.
- alfrom
The title of the link to start enumerating from.
- alto
The title of the link to stop enumerating at.
- alprefix
Search for all linked titles that begin with this value.
- alunique
Only show distinct linked titles. Cannot be used with alprop=ids.
When used as a generator, yields target pages instead of source pages.
- Type: boolean (details)
- alprop
Which pieces of information to include:
- ids
- Adds the page ID of the linking page (cannot be used with alunique).
- title
- Adds the title of the link.
- Values (separate with | or alternative): ids, title
- Default: title
- alnamespace
The namespace to enumerate.
- One of the following values: -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 90, 91, 92, 93, 100, 101, 102, 103, 104, 105, 106, 107, 486, 487, 828, 829, 1198, 1199, 2300, 2301, 2302, 2303, 2600, 5500, 5501
- Default: 0
- allimit
How many total items to return.
- No more than 500 (5,000 for bots) allowed.
- Type: integer or max
- Default: 10
- aldir
The direction in which to list.
- One of the following values: ascending, descending
- Default: ascending
Examples:
- List linked titles, including missing ones, with page IDs they are from, starting at B.
- api.php?action=query&list=alllinks&alfrom=B&alprop=ids|title [open in sandbox]
- List unique linked titles.
- api.php?action=query&list=alllinks&alunique=&alfrom=B [open in sandbox]
- Gets all linked titles, marking the missing ones.
- api.php?action=query&generator=alllinks&galunique=&galfrom=B [open in sandbox]
- Gets pages containing the links.
- api.php?action=query&generator=alllinks&galfrom=B [open in sandbox]