API: Difference between revisions

Adds API Sandbox links
 
Line 23: Line 23:
===Example Questions ===
===Example Questions ===
Here are some example requests to the API
Here are some example requests to the API
# https://freephile.org/w/api.php?action=query&meta=siteinfo&siprop=extensions With no 'format' argument, you will get a "pretty" HTML output that you can read in your browser.
# https://wiki.freephile.org/wiki/api.php?action=query&meta=siteinfo&siprop=extensions With no 'format' argument, you will get a "pretty" HTML output that you can read in your browser.
# https://freephile.org/w/api.php?action=query&meta=siteinfo&siprop=extensions&format=json With *json* explicitly requested as the format, you can get values suitable for actual programming.
# https://wiki.freephile.org/wiki/api.php?action=query&meta=siteinfo&siprop=extensions&format=json With *json* explicitly requested as the format, you can get values suitable for actual programming.
 
See [[Categories/javascript]] for an example using the internal JavaScript API '''mw.Api'''


== Developer Tools ==
== Developer Tools ==