Legal:Wikimedia Foundation TOU Machine Readability and Interaction
The Wikimedia Foundation's Terms of Use (TOU) are available in machine-readable format.
Notably, we make available a powerful API to extract, manipulate and serve the Terms of Use (and other pages we host) in a wide variety of ways.
A simple/straightforward machine operation is to retrieve the text (without HTML formatting) and return it as an XML file: https://foundation.wikimedia.org/w/api.php?action=query&prop=extracts&titles=Policy:Terms_of_Use&explaintext=1&format=xml
You can also retrieve just specific sections of the TOU, for example: https://foundation.wikimedia.org/w/api.php?action=query&prop=revisions&titles=Policy:Terms_of_Use&rvslots=main&rvprop=content&rvsection=8&format=xml (change the number after “rvsection”, in this URL, in order to retrieve different sections. The section numbering is available from this link: https://foundation.wikimedia.org/w/api.php?action=parse&page=Policy:Terms_of_Use&prop=sections&format=xml (see the corresponding entry for “number”, for the section you are looking for).
Other available formats, besides XML, include json, jsonfm, php, phpfm, rawfm, and xmlfm .
There is a whole lot more that the MediaWiki Actions API can do! The main API documentation is available here, and a helpful API Sandbox tool (to guide you through interacting with the API) is available here.
Worked example
Let’s imagine you wish to retrieve the Termination provisions of the TOU, in JSON format.
At the time of writing, the Termination section currently has index number “14”, according to https://foundation.wikimedia.org/w/api.php?action=parse&page=Policy:Terms_of_Use&prop=sections&format=xml
The following link - which uses 14 after the “rvsection”, and "json" as the format - will therefore return the Termination provisions of the current TOU in JSON format: https://foundation.wikimedia.org/w/api.php?action=query&prop=revisions&titles=Policy:Terms_of_Use&rvslots=main&rvprop=content&rvsection=14&format=json
Other possibilities
Other tools are available to leverage the machine-readability of our Terms of Use.
For example, you can use the Page History tool to automatically generate a comparison between different (archived) versions of the TOU; for help using it, see here.
Use of our software and APIs is subject to applicable terms and policies.