/notion/.
For API key setup, see Notion Setup.
Config
Filesystem Layout
pages/ hierarchy mirrors Notion’s standalone page tree. Each page
directory contains a page.json with the page metadata and content, and
child pages appear as nested directories.
The databases/ hierarchy is one level deeper than the page tree,
because the 2025-09-03 API generation split a database into a
container plus one or more data sources. The column schema and the
rows both live on the data source: data_source.json and rows.jsonl.
The name stutters for a single-source database because Notion names the
auto-created data source after its database; that disappears the moment
a database holds two.
A data source lists its rows as one file, not as a directory each. A
query answers a hundred rows’ cells in one call, while every row
directory costs calls of its own to enter, so a grep -r or find over
a large database would cost calls per row. A row is still a page with a
page.json, at <data-source-dir>/<row-title>__<page-id>/page.json: it
is not listed, and its path is on the row’s line in rows.jsonl.
database.json
The container’s identity. It carriesdatabase_id, title, url,
timestamps, parent, archived, is_inline, and the data_sources
stubs that name the directories beneath it. It does not carry
properties: at this API version the column schema lives on the data
source, and GET /v1/databases/{id} no longer answers with one.
data_source.json
The typed column schema (Notion’s own property objects), with no rows inline:ntn datasources resolve <database-id>.
rows.jsonl
Every row of the data source, one JSON object per line, in the order the query returns them. A line is the row’spage.json without the body,
which a query does not carry, plus path, where that page.json is
below the data source directory:
page.json
A page, including a database row. Notion blocks render tomarkdown and
stay available raw under blocks; a row’s cell values are under
properties, as Notion’s own property objects, answering to the schema
in the data_source.json one level up:
children key, and
the Markdown renders nested blocks with indentation. A standalone page’s
properties holds only its title, which is what the API returns for
one.
Cache
UsesIndexCacheStore for page metadata. No separate content
cache - file content caching is handled by the workspace IOResult
mechanism.
Example
Shell Commands
Standard commands available on the mounted Notion tree:
Acting on Notion (creating, editing and trashing pages, querying data
sources, and every route that has no typed verb) goes through the
ntn CLI when installed. Ids are positional: use the
<page-id> / <database-id> / <data-source-id> from a path segment as
the operand.