Notion API
📚

Notion API

Description
Notion API 정리글
category
ETC
Tag
Notion
Date
Nov 15, 2023 11:48 AM
 
참고로 Notion Language를 한글로 지정하면 속성 이름이 한글로 지정되어 유의해야 된다!!

Query a Databases

이름은 default이고 속성에 따라 검색이 가능하다.
property : “속성”
그 밑 property에 관련 검색 속성은 여기서 확인!

Shell

JSON

{ "filter": { "or": [ { "property": "이름", "title": { "contains": "" } }, { "property": "태그", "multi_select": { "contains": "asdfdfsdf" } } ] }, "sorts": [ { "property": "이름", "direction": "ascending" } ] }
 

Notion SDK

const { Client } = require('@notionhq/client'); const notion = new Client({ auth: KEY }); const posts = await notion.databases.query({ database_id: databaseId, or: [ { property: "이름", title: { contains: search } }, { property: "태그", multi_select: { contains: search } }, { property: "Description", title: { contains: search } } ] }; });