A RESTful way to use your Notion tables as a database.

Overview

rest-notion-db

A RESTful way to use your Notion tables as a database.

Use-cases

Form submissions or frontend websites, use one database that is understood by everyone at your workplace for all your needs.

Usage

In order to use the API, you need to provide your Notion token_v2 cookie and the Notion database page URL. You can obtain your token_v2 using Chrome DevTools or the like for other browsers.

GET data

Endpoint: /page/
The PAGE_ID includes the ID of the page along with the default ?v URL parameter.

Simply replace the notion.so to rest-notion-db.herokuapp.com on your database page to access the table data as a JSON response.

In case of an auth-secured page, send your token_v2 cookie as a Authorization Bearer Token header in the request.

Queries
Currently, you can sort and limit the data using request parameters.

For example:
?name=asc: sorts all the names in alphabetical order as per the default Notion intent.
?limit=5: limits the number of results in the response to 5.

You can add multiple query parameters to sort the data as per your use-cases.

Demo
Database: User Research Template

Request: https://rest-notion-db.herokuapp.com/page/1d595a4c3f9a4254b332587507e87267?v=43045489a1a44683b04154a85a562898&name=desc&limit=2
Response:

[{
    "completion_time": 20,
    "email": "",
    "name": "Kyle Miller",
    "rsvp": true,
    "status": "Cancelled",
    "task": ["Profile Editing"],
    "title": "Kyle Miller"
}, {
    "completion_time": 30,
    "email": "",
    "name": "Emily Cohen",
    "rsvp": false,
    "status": "Contacted",
    "task": ["Offline Mode", "Profile Editing"],
    "title": "Emily Cohen"
}]

POST data

Endpoint: /post

Send the Notion Page URL and the token_v2 cookie, in case of a private page, as request headers along with the JSON POST data.

In order to successfully POST, the request data keys should match the schema names and the values should match the schema datatypes.

Demo
Database: User Research Template

Request:
Headers

{
    "Authorization": "Bearer ",
    "Notion-Page-Url": "",
    "Content-Type": "application/json"
}

Body

{
    "name": "Ivan Zhao",
    "task": ["Offline Mode", "Profile Editing"],
    "status": "Scheduled",
    "completion_time": 42,
    "rsvp": true
}

Response:

{
    "message": "Added data to table successfully.",
    "success": true
}

Credits

notion-py for the unofficial Notion client wrapper.

Problems?

File an issue or contact me.

You might also like...
Notion-cli-list-manager - A simple command-line tool for managing Notion databases

A simple command-line tool for managing Notion List databases. ✨

2 Way Sync Between Notion Database and Google Calendar

Notion-and-Google-Calendar-2-Way-Sync 2 Way Sync Between a Notion Database and Google Calendar WARNING: This repo will be undergoing a good bit of cha

Turn images of tables into CSV data. Detect tables from images and run OCR on the cells.
Turn images of tables into CSV data. Detect tables from images and run OCR on the cells.

Table of Contents Overview Requirements Demo Modules Overview This python package contains modules to help with finding and extracting tabular data fr

Module for converting 2D Python lists to fancy ASCII tables. Table2Ascii lets you display pretty tables in the terminal and on Discord.
Module for converting 2D Python lists to fancy ASCII tables. Table2Ascii lets you display pretty tables in the terminal and on Discord.

table2ascii Module for converting 2D Python lists to a fancy ASCII/Unicode tables table2ascii 📥 Installation 🧑‍💻 Usage Convert lists to ASCII table

A way to export your saved reddit posts to a Notion table.
A way to export your saved reddit posts to a Notion table.

reddit-saved-to-notion A way to export your saved reddit posts and comments to a Notion table.Uses notion-sdk-py and praw for interacting with Notion

A simple bot that lives in your Telegram group, logging messages to a Postgresql database and serving statistical tables and plots to users as Telegram messages.
A simple bot that lives in your Telegram group, logging messages to a Postgresql database and serving statistical tables and plots to users as Telegram messages.

telegram-stats-bot Telegram-stats-bot is a simple bot that lives in your Telegram group, logging messages to a Postgresql database and serving statist

Automatically generate a RESTful API service for your legacy database. No code required!

sandman2 sandman2 documentation [ ~ Dependencies scanned by PyUp.io ~ ] sandman2 automagically generates a RESTful API service from your existing data

Notion API Database Python Implementation

Python Notion Database Notion API Database Python Implementation created only by database from the official Notion API. Installing / Getting started p

A library for generating fake data and populating database tables.

Knockoff Factory A library for generating mock data and creating database fixtures that can be used for unit testing. Table of content Installation Ch

Generate a roam research like Network Graph view from your Notion pages.
Generate a roam research like Network Graph view from your Notion pages.

Notion Graph View Export Notion pages to a Roam Research like graph view.

Notflix - Notion / Netflix and IMDb to organise your movie dates. Happy Valentine <3 from 0x1za
Notflix - Notion / Netflix and IMDb to organise your movie dates. Happy Valentine 3 from 0x1za

Welcome to notflix 👋 This is a project to help organise shows to watch with my

Beautiful Interactive tables in your Flask templates.
Beautiful Interactive tables in your Flask templates.

flask-tables Beautiful interactive tables in your Flask templates Resources Video demonstration: Go to YouTube video. Learn how to use this code: Go t

An easy way to access to your EPITECH subjects based on the Roslyn's database.

An easy way to access to your EPITECH subjects based on the Roslyn's database.

Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser or phone. Install it on your server, access it anywhere and enjoy.
Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser or phone. Install it on your server, access it anywhere and enjoy.

Vigilio Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser

A python software that can help blind people find things like laptops, phones, etc the same way a guide dog guides a blind person in finding his way.

GuidEye A python software that can help blind people find things like laptops, phones, etc the same way a guide dog guides a blind person in finding h

Unofficial Python API client for Notion.so
Unofficial Python API client for Notion.so

notion-py Unofficial Python 3 client for Notion.so API v3. Object-oriented interface (mapping database tables to Python classes/attributes) Automatic

A small repository with convenience functions for working with the Notion API.

Welcome! Within this respository are a few convenience functions to assist with the pulling and pushing of data from the Notion API.

Import Notion Tasks to

Notion-to-Google-Calendar (1 way) Import Notion Tasks to Google Calendar NO MORE UPDATES WILL BE MADE TO THIS REPO. Attention has been put on a 2-way

Comments
  • Not working anymore 01/03/2022

    Not working anymore 01/03/2022

    I tried with one of my private Notion table and it doest not work. I get a 404.

    Even when trying with the demo URL (https://rest-notion-db.herokuapp.com/page/1d595a4c3f9a4254b332587507e87267?v=43045489a1a44683b04154a85a562898&name=desc&limit=2) , I get a 500. See below image

    Are you planning on updating/maintaining this ? If yes, I'd be glad to use your solution.

    Thanks

    opened by VianneyMI 0
Owner
Oorjit Chowdhary
Mobile and Web Developer | Google Code-in Grand Prize Winner
Oorjit Chowdhary
Restful API framework wrapped around MongoEngine

Flask-MongoRest A Restful API framework wrapped around MongoEngine. Setup from flask import Flask from flask_mongoengine import MongoEngine from flask

Close 525 Jan 1, 2023
A RESTful whois

whois-rest A RESTful whois. Installation $ pip install poetry $ poetry install $ uvicorn app:app INFO: Started server process [64616] INFO: W

Manabu Niseki 4 Feb 19, 2022
RESTful Todolist API

RESTful Todolist API GET todolist/ POST todolist/ {"desc" : "Description of task to do"} DELETE todolist/<int:id> PUT todolist/<int:id> Requirements D

Gabriel Tavares 5 Dec 20, 2021
Python bindings for Podman's RESTful API

podman-py This python package is a library of bindings to use the RESTful API of Podman. It is currently under development and contributors are welcom

Containers 142 Jan 6, 2023
Transparently use webpack with django

Looking for maintainers This repository is unmaintained as I don't have any free time to dedicate to this effort. If you or your organisation are heav

null 2.4k Dec 24, 2022
Country-specific Django helpers, to use in Django Rest Framework

django-rest-localflavor Country-specific serializers fields, to Django Rest Framework Documentation (soon) The full documentation is at https://django

Gilson Filho 19 Aug 30, 2022
Integrate GraphQL into your Django project.

Graphene-Django A Django integration for Graphene. ?? Join the community on Slack Documentation Visit the documentation to get started! Quickstart For

GraphQL Python 4k Dec 31, 2022
Generate Views, Serializers, and Urls for your Django Rest Framework application

DRF Generators Writing APIs can be boring and repetitive work. Don't write another CRUDdy view in Django Rest Framework. With DRF Generators, one simp

Tobin Brown 332 Dec 17, 2022
Notion4ever - Python tool for export all your content of Notion page using official Notion API

NOTION4EVER Notion4ever is a small python tool that allows you to free your cont

null 50 Dec 30, 2022
A discord bot consuming Notion API to add, retrieve data to Notion databases.

Notion-DiscordBot A discord bot consuming Notion API to add and retrieve data from Notion databases. Instructions to use the bot: Pre-Requisites: a)In

Servatom 57 Dec 29, 2022