一键导入
notion-databases
Use when a Notion task needs database or data source schema, filtered queries, sorted rows, pagination, row creation, or row property updates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when a Notion task needs database or data source schema, filtered queries, sorted rows, pagination, row creation, or row property updates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when answering questions about viaim / 未来智能 products, iFLYBUDS, AI earbuds, headsets, Viaim App, software/device context, Ripple inside UI, app setup, technical support, after-sales service, company/contact information, company/product background, or viaim product background.
用户给一个播客单集 URL,抓取该期元信息、简介和原始时间轴,直接产出一份完整 Markdown:在对话里完整呈现,同时落盘到 host 可见路径。
用户给一个 B 站视频 URL / BV 号,基于已登录 B 站账号抓取元数据、字幕和官方 AI 总结,产出一份完整 Markdown 总结并落盘到 /workspace/outputs/bilibili/。
Use when a Notion task needs a raw ntn api endpoint, custom query/body parameters, pagination, schema lookup, or an endpoint without a dedicated skill.
Use when a Notion task needs file upload, image/file/PDF blocks, page cover or icon media, external URL imports, or file_upload ids.
Use when a Notion task needs page creation, page search, page metadata, Markdown/body reads, block appends, block edits, or page archiving.
| name | notion-databases |
| version | 1.0.0 |
| description | Use when a Notion task needs database or data source schema, filtered queries, sorted rows, pagination, row creation, or row property updates. |
| metadata | {"requires":{"bins":["ntn"],"connectors":["notion"]},"cliHelp":"ntn datasources --help"} |
CRITICAL — 开始前 MUST 先读取 ../notion-shared/SKILL.md。
写 filter/sort JSON 前务必先跑 ntn api --docs /v1/data_sources/{data_source_id}/query -X POST
对照官方 schema,不要凭记忆写。
parent.type = data_source_idtitle / rich_text / number / select / multi_select / date / status / checkbox / relation / ...)如果用户给的是 database id / URL,先读取 database,拿到里面的 data source:
ntn api v1/databases/{database_id} | jq '.data_sources[] | {id, name}'
如果只有一个 data source,通常直接用它;如果有多个,先列出来让用户确认。
先看它长什么样才能写对 filter 和 properties:
ntn api v1/data_sources/{data_source_id}
关键看 properties 对象,每个 key 是列名,每个 value 里的 type 是列类型。
column 类型决定了 filter 语法(下面会分开讲)。
ntn api v1/data_sources/{data_source_id}/query -d '{
"filter": {"property": "Status", "select": {"equals": "In Progress"}},
"sorts": [{"property": "Updated", "direction": "descending"}],
"page_size": 50
}'
CLI shortcut 也可以:
ntn datasources query <data-source-id> \
--filter '{"property":"Status","select":{"equals":"In Progress"}}' \
--sort "Updated desc" \
--limit 50 \
--json
| column 类型 | filter 写法 |
|---|---|
title / rich_text | {"property":"Name","rich_text":{"contains":"关键词"}} |
select | {"property":"Status","select":{"equals":"Done"}} |
multi_select | {"property":"Tags","multi_select":{"contains":"urgent"}} |
number | {"property":"Priority","number":{"greater_than":3}} |
date | {"property":"Due","date":{"on_or_before":"2026-12-31"}} |
checkbox | {"property":"Done","checkbox":{"equals":true}} |
组合(AND / OR):
{"filter":{"and":[
{"property":"Status","select":{"equals":"Todo"}},
{"property":"Due","date":{"on_or_before":"2026-06-01"}}
]}}
or 同理。AND/OR 可以嵌套两层。
和 notion-cli skill 说的一样,has_more=true → 用 next_cursor 继续:
ntn api v1/data_sources/{data_source_id}/query -d '{
"page_size": 100,
"start_cursor": "<上一页的 next_cursor>"
}'
单次上限 100,别硬塞更大的数字。
等价于"创建一个 parent 是 data source 的 page",properties 必须严格对齐 schema(字段名、类型都要对):
ntn api v1/pages -d '{
"parent": {"data_source_id": "DATA_SOURCE_ID"},
"properties": {
"Name": {"title": [{"text":{"content":"今日 TODO"}}]},
"Status": {"select": {"name": "Todo"}},
"Tags": {"multi_select":[{"name":"work"}, {"name":"urgent"}]},
"Due": {"date": {"start":"2026-05-01"}},
"Done": {"checkbox": false}
}
}'
常见翻车:
select / multi_select 的 name 必须是 data source 里已存在的选项值(否则报 validation_error)Name,具体以 data source schema 为准relation 字段的值是一个对象数组 [{"id":"PAGE_ID"}],不是字符串本质是"改 page 的 properties"。见
../notion-pages 的"改 properties(PATCH)"段落。
PATCH page + archived:true,同样见 notion-pages。
| 用户说... | 做什么 |
|---|---|
| "这个数据库有什么字段?" | 先 v1/databases/{id} 找 data source,再 v1/data_sources/{id} 看 schema |
| "按 XX 条件拉一批" | v1/data_sources/{id}/query + 对应 type 的 filter |
| "按时间排序给我列表" | 在 sorts 里加 {"property":"XX","direction":"descending"} |
| "加一条新记录" | ntn api v1/pages + parent.data_source_id |
| "把这条改成 Done" | PATCH v1/pages/{row_id} + 新 properties |
| "清空这个数据库" | 循环 archive 每一行 + 先跟用户确认,不要擅自批量处理 |
填 filter/properties 之前读一遍 schema,能少走 80% 的弯路。
不确定就 ntn api --docs /v1/data_sources/{id}/query -X POST 现查一下文档。