API:Duplicatefiles
Jump to navigation
Jump to search
| Duplicatefiles | ||
|---|---|---|
| List all files that are duplicates of the given file(s) based on hash values. This module can be used as a Generator. |
||
| Prefix | df | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
List duplicates of the given files.
Parameters[edit]
dflimit: How many duplicates to list.dfcontinue: When more results are available, use this to continue.dfdir: The direction in which to list. Possible values:ascending,descending. (Default:ascending) 1.20+dflocalonly: Look only for files in the local repository. Type: boolean 1.20+
Example[edit]
List duplicates of two images
api.php? action=query& titles=Image:1995.jpg|Image:Welcome.gif& prop=duplicatefiles [try in ApiSandbox]
| Result |
|---|
{
"batchcomplete": "",
"query": {
"pages": {
"-1": {
"ns": 6,
"title": "File:Albert Einstein Head.jpg",
"missing": "",
"known": "",
"duplicatefiles": [
{
"name": "Albert_Einstein_Head.jpg",
"user": "Triggerhippie4",
"timestamp": "2014-11-25T19:59:28Z",
"shared": ""
}
]
}
}
}
}
|
Possible errors[edit]
None
| The following documentation is the output of Special:ApiHelp/query+duplicatefiles, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
prop=duplicatefiles (df)
- This module requires read rights.
- This module can be used as a generator.
- Source: MediaWiki
- License: GPL-2.0-or-later
List all files that are duplicates of the given files based on hash values.
Parameters:
- dflimit
How many duplicate files to return.
- No more than 500 (5,000 for bots) allowed.
- Type: integer or max
- Default: 10
- dfcontinue
When more results are available, use this to continue.
- dfdir
The direction in which to list.
- One of the following values: ascending, descending
- Default: ascending
- dflocalonly
Look only for files in the local repository.
- Type: boolean (details)
Examples:
- Look for duplicates of File:Albert Einstein Head.jpg.
- api.php?action=query&titles=File:Albert_Einstein_Head.jpg&prop=duplicatefiles [open in sandbox]
- Look for duplicates of all files.
- api.php?action=query&generator=allimages&prop=duplicatefiles [open in sandbox]