Getting Started

Learn how to use our API and build your own custom sitemaps workflow, just the way you like to.

API Authentication

All authorization is done through a single API token. You can generate and/or revoke an api token at any time. To manage your api tokens, log in to your account and navigate to your settings panel. You'll find the API tab in the left sidebar. Remember to include your bearer token in the Authorization header for every API request.

{ "Authorization": "Bearer: your-secure-bearer-token-here" }

Example with curl

You can use curl to do API requests. Here's an example, including the required Authorization header.

API_TOKEN="your-api-token-here";
curl -XGET \
    -H "Authorization: Bearer ${API_TOKEN}" \ # Authenticate with Bearer token
    https://sitemap.sh/api/projects > ./results.json

Use json_pp to beautify JSON output from your command line. Here's the manpage.

Beautify JSON output

echo '[{"key":"value"},{"key2":"value2"}]' | json_pp

This should result into the following output.

[
   {
      "key" : "value"
   },
   {
      "key2" : "value2"
   }
]

Last updated

Was this helpful?