Help
Difference between revisions of "APIs"
Line 4: | Line 4: | ||
! API point || Query || Example of returned sub-item | ! API point || Query || Example of returned sub-item | ||
|- | |- | ||
− | | [https://commons.wikimedia.org/w/api.php Commons] || [https://commons.wikimedia.org/w/api.php?origin=*&action=query&format=json&ailimit=500&aistart=2018-01-01T00:00:01Z&aiuser=Yug&list=allimages&aisort=timestamp List of 500 files by User:Yug, since 2018-01-01 and after] || <pre>{ | + | | [https://commons.wikimedia.org/w/api.php Commons] || [https://commons.wikimedia.org/w/api.php?origin=*&action=query&format=json&ailimit=500&aistart=2018-01-01T00:00:01Z&aiuser=Yug&list=allimages&aisort=timestamp&aiprop=user|mime|size|url List of 500 files by User:Yug, since 2018-01-01 and after, with user and mime] || <pre>{ |
"name": "LL-Q150_(fra)-Yug-retour.wav", | "name": "LL-Q150_(fra)-Yug-retour.wav", | ||
− | " | + | "user": "Yug", |
+ | "size": 99604, | ||
+ | "width": 0, | ||
+ | "height": 0, | ||
+ | "duration": 1.128798185941043, | ||
"url": "https://upload.wikimedia.org/wikipedia/commons/5/5d/LL-Q150_%28fra%29-Yug-retour.wav", | "url": "https://upload.wikimedia.org/wikipedia/commons/5/5d/LL-Q150_%28fra%29-Yug-retour.wav", | ||
"descriptionurl": "https://commons.wikimedia.org/wiki/File:LL-Q150_(fra)-Yug-retour.wav", | "descriptionurl": "https://commons.wikimedia.org/wiki/File:LL-Q150_(fra)-Yug-retour.wav", | ||
"descriptionshorturl": "https://commons.wikimedia.org/w/index.php?curid=104350594", | "descriptionshorturl": "https://commons.wikimedia.org/w/index.php?curid=104350594", | ||
+ | "mime": "audio/wav", | ||
"ns": 6, | "ns": 6, | ||
− | "title":"File:LL-Q150 (fra)-Yug-retour.wav" | + | "title": "File:LL-Q150 (fra)-Yug-retour.wav" |
− | }</pre> | + | } |
+ | </pre> | ||
|- | |- | ||
| [https://commons.wikimedia.org/w/api.php Commons] || [https://commons.wikimedia.org/w/api.php?origin=*&action=query&format=json&lelimit=500&lestart=2022-01-01T00:00:01Z&leuser=Yug&list=logevents&letype=upload&leaction=upload/upload List of 500 log events by User:Yug, type upload/upload, from 2022-01-01 and before] || <pre>{ | | [https://commons.wikimedia.org/w/api.php Commons] || [https://commons.wikimedia.org/w/api.php?origin=*&action=query&format=json&lelimit=500&lestart=2022-01-01T00:00:01Z&leuser=Yug&list=logevents&letype=upload&leaction=upload/upload List of 500 log events by User:Yug, type upload/upload, from 2022-01-01 and before] || <pre>{ | ||
Line 31: | Line 37: | ||
}</pre> | }</pre> | ||
|} | |} | ||
+ | |||
+ | == API pages == | ||
+ | * [https://www.mediawiki.org/w/api.php?action=help&modules=query Query] | ||
+ | ** [https://www.mediawiki.org/w/api.php?action=help&modules=query%2Ballimages Query/allimages] | ||
+ | ** [https://www.mediawiki.org/w/api.php?action=help&modules=query%2Blogevents Query/logevents] | ||
== See also == | == See also == | ||
* [[Help:SPARQL]] | * [[Help:SPARQL]] | ||
[[Category:Lingua Libre:Help{{#translation:}}]] | [[Category:Lingua Libre:Help{{#translation:}}]] |
Revision as of 22:23, 22 November 2021
APIs are interface system allowing an url query to access data on a server. In the case of LinguaLibre, two APIs are used: LinguaLibre and Commons Wikimedia. Below are some useful examples.
API point | Query | Example of returned sub-item |
---|---|---|
Commons | mime|size|url List of 500 files by User:Yug, since 2018-01-01 and after, with user and mime] | { "name": "LL-Q150_(fra)-Yug-retour.wav", "user": "Yug", "size": 99604, "width": 0, "height": 0, "duration": 1.128798185941043, "url": "https://upload.wikimedia.org/wikipedia/commons/5/5d/LL-Q150_%28fra%29-Yug-retour.wav", "descriptionurl": "https://commons.wikimedia.org/wiki/File:LL-Q150_(fra)-Yug-retour.wav", "descriptionshorturl": "https://commons.wikimedia.org/w/index.php?curid=104350594", "mime": "audio/wav", "ns": 6, "title": "File:LL-Q150 (fra)-Yug-retour.wav" } |
Commons | List of 500 log events by User:Yug, type upload/upload, from 2022-01-01 and before | { "logid": 310250995, "ns": 6, "title": "File:LL-Q150 (fra)-Yug-retour.wav", "pageid": 104350594, "logpage": 104350594, "params": { "img_sha1": "annmkt852o46z5icpp2thdzyei7fla1", "img_timestamp": "2021-04-25T22:08:17Z" }, "type": "upload", "action": "upload", "user": "Yug", "timestamp": "2021-04-25T22:08:17Z", "comment": "" } |