Notion API Key 怎麼拿? 登入 Notion Developer Portal,建立一個 internal connection / integration,系統會給你一組以 ntn_ 開頭的 Integration Token。這組 token 就是多數人搜尋時說的「Notion API Key」。
拿到 token 後還不能直接讀所有資料。你還要到目標 page、database 或 data source 右上角按 Add connections,把資料授權給這個 integration,API 才讀得到。
如果你現在只想跑通,最短路徑是這 4 步:
| 步驟 | 要做什麼 | 目的 |
|---|---|---|
| 1 | 到 Notion Developer Portal 建立 connection / integration | 取得 Integration Token |
| 2 | 複製 token,先放在本機環境變數 | 避免寫死在程式碼裡 |
| 3 | 到目標 page / database 按 Add connections 授權 |
避免 403 權限錯誤 |
| 4 | 用 curl /v1/users/me 和 /v1/search 測試 |
確認 token 和授權都正常 |
先把這四步跑通,再去想 n8n、WordPress、自動化、SDK,成功率會高很多。
如果你只想快速判斷自己要拿哪一種 token,先看這張表:
| 你搜尋的字 | 通常真正要找的是 | 適合情境 |
|---|---|---|
notion api key |
Integration Token | 自己 workspace 的內部自動化 |
notion api token |
Integration Token | n8n、腳本、WordPress 同步 |
notion integration token |
Internal connection token | 最準確的新手用語 |
notion token |
可能是 Integration Token,也可能是 PAT | 要看你是內部工具還是個人腳本 |
notion api key 取得 |
Developer Portal 建 connection | 第一次串接 API |
notion_api_key |
環境變數名稱 | n8n、CLI、腳本常見設定 |
這就是最短答案。下面把每一步拆開講,並附 curl 測試與常見錯誤排查。
很多人搜尋 notion api、notion api key、notion api token,多半只是想趕快拿到 token,讓外部工具可以讀寫 Notion,還沒有要研究 API 本身。
如果你已經拿到 token,只想直接測 endpoint,可以接著看子文:Notion API 用 curl 測試教學:5 個最常用 endpoint 速查。
真正想做的通常是這幾件事:
也就是說,你不是為了炫技才需要 Notion API。
你需要它,是因為 Notion 已經變成你的資料中心,但資料不可能永遠只靠手動複製貼上。