TypeScript packages for Notion's unofficial API, data types, and related utilities.
import { NotionAPI } from 'notion-client'
const api = new NotionAPI()
// fetch a notion page's content, including all async blocks, collection queries, and signed urls
const page = await api.getPage('067dd719-a912-471e-a9a3-ac10710e7fdf')
// fetch the data for a specific collection instance
const collectionId = '2d8aec23-8281-4a94-9090-caaf823dd21a'
const collectionViewId = 'ab639a5a-853e-45e1-9ef7-133b486c0acf'
const colectionData = await api.getCollectionData(
collectionId,
collectionViewId
)
You can optionally pass an authToken
to NotionAPI
if you need to access private notion resources.
notion-client
is compatible with Node.js, Deno, and Cloudflare Workers.The majority of Notion blocks and collection views are fully supported.
Please let us know if you find any issues or missing blocks.