The REST API supports responses in several formats. You specify the response format using the query parameter
f. A list of valid formats is included for each of the resources and operations where
f is a parameter.
To view the Services Directory page for the root directory of ArcGIS Online, you would use the following URL:
Note that since "html" is the default value, you are not required to include this parameter in the URL. This means that the above URL is equivalent to the following URL:
To retrieve the information in a JSON object, you would use the following URL:
You can also reference a callback function in the URL:
If you want the JSON object to be more readable, you can use
pjson. You should not include this parameter in your production applications as it will affect performance. Use the parameter for debugging purposes only.
In the following example, a request is made for a KML footprint of a map service with an extent of the United States:
For more information about kml as an output option, see KML support.