
Notion Has a Free API — Build Custom Dashboards and Automate Your Workflow
Notion Is Not Just a Note App Notion API lets you programmatically read, create, and update pages, databases, and blocks. Free for personal use, included in all plans. Setup Go to notion.so/my-integrations Create new integration Copy the API key Share your database/page with the integration import requests TOKEN = " your_notion_api_key " HEADERS = { " Authorization " : f " Bearer { TOKEN } " , " Content-Type " : " application/json " , " Notion-Version " : " 2022-06-28 " } Query a Database def query_database ( db_id , filter_obj = None ): data = {} if filter_obj : data [ " filter " ] = filter_obj r = requests . post ( f " https://api.notion.com/v1/databases/ { db_id } /query " , headers = HEADERS , json = data ) results = r . json ()[ " results " ] return [{ " id " : p [ " id " ], " props " : { k : v for k , v in p [ " properties " ]. items ()}} for p in results ] # Get all items where Status = "Done" items = query_database ( " your_db_id " , { " property " : " Status " , " status " : {
Continue reading on Dev.to
Opens in a new tab




