Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

notion

БесплатноБез исполняемых скриптовНе проверен

Build integrations with the Notion API: databases and data sources, pages, blocks, search, and OAuth. Use when tasks involve reading or writing Notion…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Notion API Integration

Overview

The Notion REST API (https://api.notion.com/v1) reads and writes pages, blocks and databases that have been shared with a connection (what Notion's UI calls an integration). Since API version 2025-09-03 a database is a container of one or more data sources; rows are queried and their schema read through /v1/data_sources/{id}, not /v1/databases/{id}. Version 2026-03-11 (the latest at the time of writing) renamed archived to in_trash and replaced the after parameter of block append with position. This skill uses 2026-03-11 throughout.

Instructions

Authentication

Create a connection at https://www.notion.so/my-integrations, copy its token, and share each target page or database with it (page menu, Connections). Keep the token in an environment variable:

export NOTION_TOKEN="ntn_..."   # from the connection's Configuration tab

For apps used by many workspaces, create a public connection and use OAuth 2.0: send the user to https://api.notion.com/v1/oauth/authorize?owner=user&client_id=...&redirect_uri=...&response_type=code, then POST the returned code (grant_type=authorization_code, same redirect_uri) to https://api.notion.com/v1/oauth/token with HTTP Basic auth client_id:client_secret. Each user authorizes separately. The Notion-Version header is required on every request.

Client setup and rate limits

"""notion_client.py — shared request helper with retry on 429/529/503."""
import os
import time
import requests

API = "https://api.notion.com/v1"
HEADERS = {
    "Authorization": f"Bearer {os.environ['NOTION_TOKEN']}",
    "Notion-Version": "2026-03-11",
    "Content-Type": "application/json",
}

def call(method: str, path: str, **kwargs) -> dict:
    """Send a request; wait for Retry-After on HTTP 429 or 529, back off on 503 for GET."""
    for attempt in range(5):
        resp = requests.request(method, f"{API}{path}", headers=HEADERS, timeout=30, **kwargs)
        if resp.status_code in (429, 529):
            time.sleep(int(resp.headers.get("Retry-After", 2 ** attempt)))
            continue
        if resp.status_code == 503 and method == "GET":
            time.sleep(2 ** attempt)
            continue
        resp.raise_for_status()
        return resp.json()
    raise RuntimeError(f"Notion request kept failing: {method} {path}")

Limits: each connection gets 180 requests per minute (about 3 per second; 600 per minute on Business and Enterprise workspaces), data source queries about 3 per second, and a separate workspace-wide budget exists. Do not retry a failed write blindly after a 503: check whether it was applied first. At most 100 blocks go in one append request, and a request body is limited in size.

Find the data source of a database

A database ID (from the URL) is not enough for queries. Fetch its data sources once and store the ID:

def get_data_source_id(database_id: str) -> str:
    """Return the first data source ID of a database (most databases have one)."""
    db = call("GET", f"/databases/{database_id}")
    return db["data_sources"][0]["id"]

Search also returns data source objects: {"filter": {"property": "object", "value": "data_source"}} ("database" was the value before 2025-09-03).

Query, create and update rows

def query_data_source(data_source_id: str, filter_obj: dict = None, sorts: list = None) -> list:
    """Return all pages of a data source matching the filter, following the cursor."""
    body = {"page_size": 100}
    if filter_obj:
        body["filter"] = filter_obj
    if sorts:
        body["sorts"] = sorts
    pages = []
    while True:
        data = call("POST", f"/data_sources/{data_source_id}/query", json=body)
        pages.extend(data["results"])
        if not data.get("has_more"):
            return pages
        body["start_cursor"] = data["next_cursor"]

def create_page(data_source_id: str, properties: dict, children: list = None) -> dict:
    """Create a row (page) in a data source."""
    body = {"parent": {"data_source_id": data_source_id}, "properties": properties}
    if children:
        body["children"] = children
    return call("POST", "/pages", json=body)

def update_page(page_id: str, properties: dict) -> dict:
    """Change properties of an existing page."""
    return call("PATCH", f"/pages/{page_id}", json={"properties": properties})

def trash_page(page_id: str) -> dict:
    """Move a page to the trash (restorable from the Notion UI)."""
    return call("PATCH", f"/pages/{page_id}", json={"in_trash": True})

Querying returns at most 10,000 results per query; narrow the filter for bigger sets. Example filter: {"property": "Status", "select": {"equals": "In Progress"}}; combine with {"and": [...]} or {"or": [...]}.

Property values

properties = {
    "Name": {"title": [{"text": {"content": "Fix login redirect"}}]},      # every data source has one title property
    "D
Полный SKILL.md на GitHub

Установить notion в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл notion?

Build integrations with the Notion API: databases and data sources, pages, blocks, search, and OAuth. Use when tasks involve reading or writing Notion workspace data, syncing external tools with a Notion database, building dashboards from Notion content, or automating page creation and updates.

Как установить скилл notion?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл notion запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить notion с