360 Secure SkillHub
360 安全技能中心

Notion API Tools

提供基于 Node 的 Notion API 命令行工具,通过 NOTION_KEY 环境变量或本地配置文件鉴权,支持搜索内容、按数据源查询数据库以及向数据库创建页面,所有命令结果以 JSON 输出到 stdout。

分类:知识
timenotspace
timenotspace
热度 58.75
最近更新 2026-05-11 15:50:57

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add timenotspace/notion-api
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
notion-api
description
Generic Notion API CLI (Node) for search, querying data sources (databases), and creating pages. Configure with NOTION_KEY (or ~/.config/notion/api_key).

notion-api (generic)

This skill provides a small Node-based CLI for the Notion API. It’s designed to be shareable: no hard-coded database IDs and no secrets in the repo.

Auth

Provide a Notion integration token via either:

  • NOTION_KEY env var, or
  • ~/.config/notion/api_key (first line)

Also make sure the target pages/databases are shared with your integration in Notion.

Commands (CLI)

Run via:

  • node scripts/notion-api.mjs <command> ...

Search

node scripts/notion-api.mjs search "query" --page-size 10

Query a data source (database query)

node scripts/notion-api.mjs query --data-source-id <DATA_SOURCE_ID> --page-size 10
# optionally pass raw JSON body:
node scripts/notion-api.mjs query --data-source-id <ID> --body '{"filter": {...}, "sorts": [...], "page_size": 10}'

Create a page in a database

node scripts/notion-api.mjs create-page --database-id <DATABASE_ID> --title "My item" --title-prop Name

Output

All commands print JSON to stdout.

Notes

  • Notion API version header defaults to 2025-09-03 (override with NOTION_VERSION).
  • Rate limits apply; prefer page_size and minimal calls.