
Notion Has a Free API — Create Pages, Query Databases, and Automate Your Workspace
Notion is where I manage everything — notes, projects, clients, content calendar. But I was doing everything manually until I discovered their API. Now I automate 80% of my Notion workflow with simple scripts. Getting Started (3 minutes) Go to notion.so/my-integrations Create a new integration Copy the API token Share your database with the integration (click Share in Notion, add your integration) Query a Database import requests NOTION_TOKEN = ' your_token ' DATABASE_ID = ' your_database_id ' headers = { ' Authorization ' : f ' Bearer { NOTION_TOKEN } ' , ' Notion-Version ' : ' 2022-06-28 ' , ' Content-Type ' : ' application/json ' } def query_database ( database_id , filter_obj = None ): url = f ' https://api.notion.com/v1/databases/ { database_id } /query ' payload = {} if filter_obj : payload [ ' filter ' ] = filter_obj response = requests . post ( url , headers = headers , json = payload ) return response . json ()[ ' results ' ] # Get all items items = query_database ( DATABASE_I
Continue reading on Dev.to JavaScript
Opens in a new tab




