jpskill.com
📄 ドキュメント コミュニティ

notion-api

Notionの検索、ページ作成・更新、データベース操作など、Notionに関する様々な要望に応え、必要な情報を探し出したり、コンテンツを編集したり、Notionの機能を活用した作業を支援するSkill。

📜 元の英語説明(参考)

This skill should be used when the user asks to "search Notion", "find in Notion", "search my Notion workspace", "create Notion page", "make a Notion page", "update Notion page", "edit Notion page", "query Notion database", "get Notion database", "read Notion page", "get page content from Notion", "list Notion pages", or mentions Notion integration, Notion workspace, or Notion API access.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Notionの検索、ページ作成・更新、データベース操作など、Notionに関する様々な要望に応え、必要な情報を探し出したり、コンテンツを編集したり、Notionの機能を活用した作業を支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o notion-api.zip https://jpskill.com/download/17553.zip && unzip -o notion-api.zip && rm notion-api.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17553.zip -OutFile "$d\notion-api.zip"; Expand-Archive "$d\notion-api.zip" -DestinationPath $d -Force; ri "$d\notion-api.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して notion-api.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → notion-api フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
8

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Notion API連携

Bun経由で実行されるTypeScriptスクリプトを通じて、Notionのページ、データベース、およびコンテンツにアクセスします。

概要

このスキルは、Notion APIへのアクセスを提供し、以下の機能を利用できます。

  • 検索: ワークスペース全体のページとデータベースを検索します
  • ページ: ページの取得、作成、および更新を行います
  • データベース: フィルタリングとソートを使用してデータベースエントリをクエリします
  • ブロック: ページコンテンツをブロックとして読み取ります

すべてのスクリプトはJSONを返し、NOTION_TOKEN環境変数を必要とします。

レスポンス形式

すべてのスクリプトは、一貫した構造でJSONを出力します。

成功

{"status": "success", "data": {...}}

認証が必要

{
  "status": "auth_required",
  "message": "Set NOTION_TOKEN environment variable with your integration token...",
  "setupUrl": "https://www.notion.so/my-integrations"
}

auth_requiredを受け取った場合は、ユーザーに以下を表示します。

To access Notion, you need to set up an integration:
1. Go to: https://www.notion.so/my-integrations
2. Create a new integration for your workspace
3. Copy the "Internal Integration Secret"
4. Set the NOTION_TOKEN environment variable with this token
5. Share your pages/databases with the integration (click "..." menu > "Add connections")

Let me know when you've completed setup.

エラー

{"status": "error", "error": "Error description"}

検索

Notionワークスペース全体のページとデータベースを検索します。

すべてのスクリプトは${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/にあります。

# クエリに一致するページ/データベースを検索します
bun run ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/search.ts --query "meeting notes"

# ページのみを検索します
bun run search.ts --query "project" --filter page

# データベースのみを検索します
bun run search.ts --filter database --top 20

# アクセス可能なすべてのアイテムをリストします(クエリなし)
bun run search.ts --top 10

ページ

Notionページの取得、作成、および更新を行います。

ページの取得

bun run ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/pages.ts get --id <page-id>

ページの作成

# 別のページの子として作成します
bun run pages.ts create --parent-id <page-id> --title "New Page"

# アイコン付きで別のページの子として作成します
bun run pages.ts create --parent-id <page-id> --title "New Page" --icon "📝"

# データベースエントリとして作成します
bun run pages.ts create --parent-id <database-id> --parent-type database --title "New Entry"

# プロパティ付きでデータベースエントリを作成します
bun run pages.ts create --parent-id <db-id> --parent-type database --title "Task" \
  --properties '{"Status": {"select": {"name": "To Do"}}, "Priority": {"select": {"name": "High"}}}'

ページの更新

# タイトルを更新します
bun run pages.ts update --id <page-id> --title "Updated Title"

# アイコンを更新します
bun run pages.ts update --id <page-id> --icon "🎉"

# ページをアーカイブします
bun run pages.ts update --id <page-id> --archived true

# アーカイブされたページを復元します
bun run pages.ts update --id <page-id> --archived false

# データベースページのプロパティを更新します
bun run pages.ts update --id <page-id> --properties '{"Status": {"select": {"name": "Done"}}}'

データベース

Notionデータベースに関する情報のクエリと取得を行います。

データベーススキーマの取得

bun run ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/databases.ts get --id <database-id>

データベースのタイトル、説明、およびすべてのプロパティ定義を返します。

データベースのクエリ

# すべてのエントリをクエリします
bun run databases.ts query --id <database-id>

# 制限付きでクエリします
bun run databases.ts query --id <db-id> --top 20

# フィルタ付きでクエリします
bun run databases.ts query --id <db-id> --filter '{"property": "Status", "select": {"equals": "Done"}}'

# 複数の条件(AND)でクエリします
bun run databases.ts query --id <db-id> --filter '{"and": [
  {"property": "Status", "select": {"equals": "In Progress"}},
  {"property": "Priority", "select": {"equals": "High"}}
]}'

# ソート付きでクエリします
bun run databases.ts query --id <db-id> --sorts '[{"property": "Created", "direction": "descending"}]'

# 最終編集時刻でソートします
bun run databases.ts query --id <db-id> --sorts '[{"timestamp": "last_edited_time", "direction": "descending"}]'

一般的なフィルタの例

# テキストに含む
--filter '{"property": "Name", "rich_text": {"contains": "project"}}'

# チェックボックスがオンになっている
--filter '{"property": "Done", "checkbox": {"equals": true}}'

# 日付が後
--filter '{"property": "Due Date", "date": {"after": "2024-01-01"}}'

# 数値がより大きい
--filter '{"property": "Score", "number": {"greater_than": 80}}'

# OR条件
--filter '{"or": [
  {"property": "Status", "select": {"equals": "Done"}},
  {"property": "Status", "select": {"equals": "Archived"}}
]}'

ブロック(ページコンテンツ)

ページコンテンツをブロックとして読み取ります。

ページブロックのリスト

# ページからブロックを取得します
bun run ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/blocks.ts list --id <page-id>

# 制限付きでブロックを取得します
bun run blocks.ts list --id <page-id> --top 100

# 再帰的にブロックを取得します(ネストされたコンテンツを含む)
bun run blocks.ts list --id <page-id> --recursive

特定のブロックの取得

bun run blocks.ts get --id <block-id>

ブロックの種類

ブロックは、paragraph、heading_1、heading_2、heading_3、bulleted_list_item、numbered_list_item、to_do、toggle、code、quote、callout、divider、table、image、bookmarkなどがあります。

各ブロックには以下が含まれます。

  • id: ブロック識別子
  • type: ブロックの種類
  • content: テキストコンテンツ(該当する場合)
  • hasChildren: ブロックにネストされたブロックがあるかどうか
  • children: ネストされたブロック(--recursiveを使用する場合)

認証設定

  1. https://www.notion.so/my-integrations にアクセスします
  2. 「New integration」をクリックします
  3. 名前を付けてワークスペースを選択します
  4. 「Internal Integration Secret」をコピーします
  5. 環境変数を設定します。
    export NOTION_TOKEN=secret_xxxxx
  6. ページ/データベースを連携と共有します。
    • Notionでページまたはデータベースを開きます
    • 右上の「...」メニューをクリックします
    • 「Add connections」を選択します
    • 連携を見つけて選択します

重要な注意点

  • 共有が必要
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Notion API Integration

Access Notion pages, databases, and content through TypeScript scripts executed via Bun.

Overview

This skill provides access to the Notion API for:

  • Search: Find pages and databases across your workspace
  • Pages: Get, create, and update pages
  • Databases: Query database entries with filters and sorting
  • Blocks: Read page content as blocks

All scripts return JSON and require a NOTION_TOKEN environment variable.

Response Format

All scripts output JSON with a consistent structure:

Success

{"status": "success", "data": {...}}

Authentication Required

{
  "status": "auth_required",
  "message": "Set NOTION_TOKEN environment variable with your integration token...",
  "setupUrl": "https://www.notion.so/my-integrations"
}

When you receive auth_required, display to the user:

To access Notion, you need to set up an integration:
1. Go to: https://www.notion.so/my-integrations
2. Create a new integration for your workspace
3. Copy the "Internal Integration Secret"
4. Set the NOTION_TOKEN environment variable with this token
5. Share your pages/databases with the integration (click "..." menu > "Add connections")

Let me know when you've completed setup.

Error

{"status": "error", "error": "Error description"}

Search

Search for pages and databases across your Notion workspace.

All scripts are located at ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/.

# Search for pages/databases matching a query
bun run ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/search.ts --query "meeting notes"

# Search only pages
bun run search.ts --query "project" --filter page

# Search only databases
bun run search.ts --filter database --top 20

# List all accessible items (no query)
bun run search.ts --top 10

Pages

Get, create, and update Notion pages.

Get Page

bun run ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/pages.ts get --id <page-id>

Create Page

# Create as child of another page
bun run pages.ts create --parent-id <page-id> --title "New Page"

# Create as child of another page with icon
bun run pages.ts create --parent-id <page-id> --title "New Page" --icon "📝"

# Create as database entry
bun run pages.ts create --parent-id <database-id> --parent-type database --title "New Entry"

# Create database entry with properties
bun run pages.ts create --parent-id <db-id> --parent-type database --title "Task" \
  --properties '{"Status": {"select": {"name": "To Do"}}, "Priority": {"select": {"name": "High"}}}'

Update Page

# Update title
bun run pages.ts update --id <page-id> --title "Updated Title"

# Update icon
bun run pages.ts update --id <page-id> --icon "🎉"

# Archive page
bun run pages.ts update --id <page-id> --archived true

# Restore archived page
bun run pages.ts update --id <page-id> --archived false

# Update database page properties
bun run pages.ts update --id <page-id> --properties '{"Status": {"select": {"name": "Done"}}}'

Databases

Query and get information about Notion databases.

Get Database Schema

bun run ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/databases.ts get --id <database-id>

Returns the database title, description, and all property definitions.

Query Database

# Query all entries
bun run databases.ts query --id <database-id>

# Query with limit
bun run databases.ts query --id <db-id> --top 20

# Query with filter
bun run databases.ts query --id <db-id> --filter '{"property": "Status", "select": {"equals": "Done"}}'

# Query with multiple conditions (AND)
bun run databases.ts query --id <db-id> --filter '{"and": [
  {"property": "Status", "select": {"equals": "In Progress"}},
  {"property": "Priority", "select": {"equals": "High"}}
]}'

# Query with sorting
bun run databases.ts query --id <db-id> --sorts '[{"property": "Created", "direction": "descending"}]'

# Sort by last edited time
bun run databases.ts query --id <db-id> --sorts '[{"timestamp": "last_edited_time", "direction": "descending"}]'

Common Filter Examples

# Text contains
--filter '{"property": "Name", "rich_text": {"contains": "project"}}'

# Checkbox is checked
--filter '{"property": "Done", "checkbox": {"equals": true}}'

# Date is after
--filter '{"property": "Due Date", "date": {"after": "2024-01-01"}}'

# Number greater than
--filter '{"property": "Score", "number": {"greater_than": 80}}'

# OR conditions
--filter '{"or": [
  {"property": "Status", "select": {"equals": "Done"}},
  {"property": "Status", "select": {"equals": "Archived"}}
]}'

Blocks (Page Content)

Read page content as blocks.

List Page Blocks

# Get blocks from a page
bun run ${CLAUDE_PLUGIN_ROOT}/skills/notion/scripts/blocks.ts list --id <page-id>

# Get blocks with limit
bun run blocks.ts list --id <page-id> --top 100

# Get blocks recursively (includes nested content)
bun run blocks.ts list --id <page-id> --recursive

Get Specific Block

bun run blocks.ts get --id <block-id>

Block Types

Blocks can be: paragraph, heading_1, heading_2, heading_3, bulleted_list_item, numbered_list_item, to_do, toggle, code, quote, callout, divider, table, image, bookmark, and more.

Each block includes:

  • id: Block identifier
  • type: Block type
  • content: Text content (if applicable)
  • hasChildren: Whether block has nested blocks
  • children: Nested blocks (when using --recursive)

Authentication Setup

  1. Go to https://www.notion.so/my-integrations
  2. Click "New integration"
  3. Give it a name and select the workspace
  4. Copy the "Internal Integration Secret"
  5. Set the environment variable:
    export NOTION_TOKEN=secret_xxxxx
  6. Share pages/databases with the integration:
    • Open the page or database in Notion
    • Click the "..." menu in the top right
    • Select "Add connections"
    • Find and select your integration

Important Notes

  • Sharing required: Pages and databases must be shared with your integration before they can be accessed
  • Rate limits: Notion API allows ~3 requests per second on average
  • Page IDs: Can be found in the page URL (the 32-character string after the page name)
  • Database IDs: Same format as page IDs, found in the database URL

Script Reference

Script Purpose
search.ts Search pages and databases across workspace
pages.ts Get, create, update pages
databases.ts Get database schema, query entries
blocks.ts Read page content as blocks

Additional Resources

For detailed API reference, see:

  • references/notion-api.md - Notion API endpoints and parameters

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。