This guide shows you how to export a Slite doc and all its subdocs using our Slite API and a simple Python script.
New in the Slite API: You can now fetch an entire document subtree directly using
GET /v1/notes/{id}/children?includeDescendants=true, eliminating the need to recurse children client-side. The API also supports exporting in SliteML (format=sliteml) and HTML with stripped styles (format=html&css=none).Prerequisites
1) Install Python
You will need to install Python on your computer.
Refer to the guides below and pick the one that corresponds to your operating system.
2) Install the dependencies
Run the following command in the Terminal app:
python3 -m pip install requestsRun the export script
Here's an example of how you can export a doc and its subdocs using a Python script:
Download this Python script:
slite_export.py
8KB, Uploaded last year
Open the Terminal app on your computer.
Run this command:
python3 slite_export.py .

After running the script, you’ll be asked for two things:
- Your Slite API key
- The ID of the parent doc you want to export
