Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Notion?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ashish7802-notion)
# Notion API & SDK Skill
> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18
> **Official Docs:** https://developers.notion.com/reference/intro
## Overview
The Notion API enables programmatic reading and writing of workspace pages, databases (data sources), rich-text blocks, comments, and users via `@notionhq/client`.
## Installation
```bash
npm install @notionhq/client
pip install notion-client
```
## Authentication
Authenticate using an Internal Integration Token (`NOTION_API_KEY`, sent as `Authorization: Bearer <token>`) or OAuth 2.0 public integration tokens. Always pass the `Notion-Version` header (handled automatically by `@notionhq/client`). Remember: **an integration can only access pages/databases explicitly shared with it** via the page's Connections menu.
## Core Concepts
- **Cursor Pagination**: List endpoints (`databases.query`, `blocks.children.list`, `search`) return up to 100 items with `has_more` and `next_cursor`. Always loop until `has_more === false`.
- **Blocks Tree**: Page content is stored as nested child blocks; reading full page text requires traversing `blocks.children.list` recursively for blocks where `has_children === true`.
- **Rate Limits**: Average sustained limit is **3 requests per second per integration** (with short bursts). HTTP `429` responses include a `Retry-After` header in seconds.
## Error Handling & Rate Limits
- Check `isNotionClientError(err)` and inspect `err.code` (`APIErrorCode.RateLimited`, `ObjectNotFound`, `ConflictError`).
- Respect `Retry-After` on HTTP `429` and throttle concurrent sync jobs to <= 3 RPS.
## Security Best Practices
- Grant integrations minimum required capabilities (e.g., Read Content only for static site generators).
- Never expose `NOTION_API_KEY` in browser code.
## AI Pitfalls
- Assuming an integration token automatically has workspace-wide access (produces `404 object_not_found` until shared with the integration).
- Ignoring `has_more` / `next_cursor`, silently truncating results at 100 items.
- Firing `Promise.all()` across hundreds of pages without concurrency throttling, immediately triggering HTTP `429`.
## Production Checklist
- [ ] `NOTION_API_KEY` stored in server-side env vars with least-privilege capabilities
- [ ] All list/query calls paginate via `has_more` + `next_cursor`
- [ ] Concurrency queue caps throughput around 3 req/sec and honors `Retry-After`
- [ ] `object_not_found` errors handled with clear sharing diagnostics
## References
- [Notion API Reference](https://developers.notion.com/reference/intro)
- [Notion Request Limits](https://developers.notion.com/reference/request-limits)
## Related skills
- [`linear`](../linear/SKILL.md) — works well with
- [`slack`](../slack/SKILL.md) — works well with
- [`github`](../github/SKILL.md) — works well with