API:Fileusage
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Searching (by title, content, coordinates...)
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Create and edit pages
- Move pages
- Merge pages
- Rollback
- Delete pages
- Restore deleted revisions
- (Un)protect pages
- (Un)block users
- (Un)watch pages
- Mark revisions of watched pages as visited
- Send email
- Patrol changes
- Import pages
- Change user group membership
- Upload files
- User options
- Tokens
- Page language
- More...
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| Fileusage | ||
|---|---|---|
| Find all pages that use the given files. This module can be used as a Generator. |
||
| Prefix | fu | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Find all pages that use the given files. This module can be used as a generator.
Parameters[edit]
fuprop: Which properties to get. (Default:pageid|title|redirect)pageid: Get the page id of each page.title: Get the title of each page.redirect: Flag whether the page is a redirect.
funamespace: Only include pages in these namespaces.fushow: Show only items that meet these criteria.redirect: Only show redirects.!redirect: Only show non-redirects.
fulimit: The number of results to return. No more than 500 (5000 for bots) allowed. (Default: 10)fucontinue: When more results are available, use this to continue.
Example[edit]
Get a list of pages using Example.jpg.
| Result |
|---|
{
"query": {
"pages": {
"586539": {
"pageid": 586539,
"ns": 6,
"title": "File:Example.jpg",
"fileusage": [
{
"pageid": 57741,
"ns": 1,
"title": "Talk:Ebola virus"
},
{
"pageid": 85076,
"ns": 1,
"title": "Talk:Case sensitivity"
},
{
"pageid": 165974,
"ns": 1,
"title": "Talk:Asia"
},
{
"pageid": 243414,
"ns": 5,
"title": "Wikipedia talk:Alternative text for images"
},
{
"pageid": 256889,
"ns": 4,
"title": "Wikipedia:Manual of Style/Images"
},
{
"pageid": 428971,
"ns": 3,
"title": "User talk:Centrx"
},
{
"pageid": 447341,
"ns": 5,
"title": "Wikipedia talk:Extended image syntax"
},
{
"pageid": 499974,
"ns": 4,
"title": "Wikipedia:Tutorial/Formatting"
},
{
"pageid": 663437,
"ns": 1,
"title": "Talk:Banjo-Kazooie"
},
{
"pageid": 728041,
"ns": 10,
"title": "Template:Infobox video game"
}
]
}
}
}
}
|
Possible errors[edit]
| Code | Info |
|---|---|
| fushow | Incorrect parameter - mutually exclusive values may not be supplied |
| The following documentation is the output of Special:ApiHelp/query+fileusage, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
prop=fileusage (fu)
- This module requires read rights.
- This module can be used as a generator.
- Source: MediaWiki
- License: GPL-2.0+
Find all pages that use the given files.
Parameters:
- fuprop
Which properties to get:
- pageid
- Page ID of each page.
- title
- Title of each page.
- redirect
- Flag if the page is a redirect.
- Values (separate with | or alternative): pageid, title, redirect
- Default: pageid|title|redirect
- funamespace
Only include pages in these namespaces.
- Values (separate with | or alternative): 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
- To specify all values, use *.
- fushow
Show only items that meet these criteria:
- redirect
- Only show redirects.
- !redirect
- Only show non-redirects.
- Values (separate with | or alternative): redirect, !redirect
- fulimit
How many to return.
- No more than 500 (5,000 for bots) allowed.
- Type: integer or max
- Default: 10
- fucontinue
When more results are available, use this to continue.
Examples:
- Get a list of pages using File:Example.jpg.
- api.php?action=query&prop=fileusage&titles=File%3AExample.jpg [open in sandbox]
- Get information about pages using File:Example.jpg.
- api.php?action=query&generator=fileusage&titles=File%3AExample.jpg&prop=info [open in sandbox]