See the API documentation on mediawiki.org.
There are also some convenient tools for experiments. These are not part of the public API.