DEV Community

Alex Spinov
Alex Spinov

Posted on

Notion Has a Free API — Build Dashboards, Automate Workflows, and Query Databases Programmatically

Notion isn't just a note-taking app — it has a full REST API that lets you create pages, query databases, manage content, and build automations. The free tier gives you everything you need.

Here's how to start using it in under 5 minutes.

Get Your Free API Key

  1. Go to developers.notion.com
  2. Click "Create new integration"
  3. Give it a name, select your workspace
  4. Copy your Internal Integration Token (starts with ntn_)

Then share your Notion database/page with the integration (click "..." → "Connections" → add your integration).

1. Query a Database

This is the most powerful endpoint. You can filter, sort, and paginate through any Notion database.

curl -X POST "https://api.notion.com/v1/databases/YOUR_DATABASE_ID/query" \
  -H "Authorization: Bearer ntn_YOUR_TOKEN" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "property": "Status",
      "select": { "equals": "Done" }
    },
    "sorts": [{ "property": "Created", "direction": "descending" }]
  }'
Enter fullscreen mode Exit fullscreen mode

2. Create a Page

Add a new entry to any database programmatically.

curl -X POST "https://api.notion.com/v1/pages" \
  -H "Authorization: Bearer ntn_YOUR_TOKEN" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{
    "parent": { "database_id": "YOUR_DATABASE_ID" },
    "properties": {
      "Name": { "title": [{ "text": { "content": "New Task" } }] },
      "Status": { "select": { "name": "In Progress" } },
      "Priority": { "select": { "name": "High" } }
    }
  }'
Enter fullscreen mode Exit fullscreen mode

3. Search Across Your Workspace

Find any page or database by title.

curl -X POST "https://api.notion.com/v1/search" \
  -H "Authorization: Bearer ntn_YOUR_TOKEN" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{ "query": "meeting notes" }'
Enter fullscreen mode Exit fullscreen mode

4. Python Example — CRM Dashboard

import requests

NOTION_TOKEN = "ntn_YOUR_TOKEN"
DATABASE_ID = "YOUR_DATABASE_ID"

headers = {
    "Authorization": f"Bearer {NOTION_TOKEN}",
    "Notion-Version": "2022-06-28",
    "Content-Type": "application/json"
}

def get_all_contacts():
    url = f"https://api.notion.com/v1/databases/{DATABASE_ID}/query"
    response = requests.post(url, headers=headers, json={
        "sorts": [{"property": "Last Contact", "direction": "descending"}]
    })
    results = response.json().get("results", [])
    for item in results[:5]:
        props = item["properties"]
        name = props.get("Name", {}).get("title", [{}])[0].get("plain_text", "N/A")
        print(f"Contact: {name}")

get_all_contacts()
Enter fullscreen mode Exit fullscreen mode

5. Node.js Example — Auto-Create Tasks

const NOTION_TOKEN = "ntn_YOUR_TOKEN";
const DATABASE_ID = "YOUR_DATABASE_ID";

async function createTask(title, status = "To Do") {
  const res = await fetch("https://api.notion.com/v1/pages", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${NOTION_TOKEN}`,
      "Notion-Version": "2022-06-28",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      parent: { database_id: DATABASE_ID },
      properties: {
        Name: { title: [{ text: { content: title } }] },
        Status: { select: { name: status } },
      },
    }),
  });
  const data = await res.json();
  console.log(`Created: ${data.id}`);
}

createTask("Review pull requests", "In Progress");
Enter fullscreen mode Exit fullscreen mode

Rate Limits

Tier Limit
Free integration 3 requests/second
Average page size ~1 KB response

The free tier handles most automation use cases without issues.

What You Can Build

  • Personal CRM — track contacts, meetings, follow-ups
  • Content calendar — auto-populate from RSS feeds or social media
  • Project dashboard — pull Notion tasks into a custom frontend
  • Daily standup bot — create standup entries automatically
  • Invoice tracker — manage invoices with auto-status updates

More Free API Articles


Need Web Data? Try These Tools

If you're building apps that need web scraping or data extraction, check out my ready-made tools on Apify Store — scrapers for Reddit, YouTube, Google News, Trustpilot, and 80+ more. No coding needed, just run and get your data.

Need a custom scraping solution? Email me at spinov001@gmail.com


More Free APIs You Should Know About

Need custom data scraping? Email me or check my Apify actors.

Top comments (0)