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.

Owner
Oorjit Chowdhary
Mobile and Web Developer | Google Code-in Grand Prize Winner
Oorjit Chowdhary
Estudo e desenvolvimento de uma API REST

Estudo e desenvolvimento de uma API REST 🧑‍💻 Tecnologias Esse projeto utilizará as seguintes tecnologias: Git Python Flask DBeaver Vscode SQLite 🎯

Deusimar 7 May 30, 2022
A RESTful way to use your Notion tables as a database.

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

Oorjit Chowdhary 42 Dec 27, 2022
A Django-powered API with various utility apps / endpoints.

A Django-powered API Includes various utility apps / endpoints. Demos These web apps provide a frontend to the APIs in this project. Issue API Explore

Shemar Lindie 0 Sep 13, 2021
REST implementation of Django authentication system.

djoser REST implementation of Django authentication system. djoser library provides a set of Django Rest Framework views to handle basic actions such

Sunscrapers 2.2k Jan 01, 2023
Scaffold django rest apis like a champion 🚀

scaffold django rest apis like a champion 🚀

Abdenasser Elidrissi 133 Jan 05, 2023
Recursive Serialization for Django REST framework

djangorestframework-recursive Overview Recursive Serialization for Django REST framework This package provides a RecursiveField that enables you to se

336 Dec 28, 2022
Kong API Manager with Prometheus And Splunk

API Manager Stack Run Kong Server + Konga + Prometheus + Grafana + API & DDBB + Splunk Clone the proyect and run docker-compose up

Santiago Fernandez 82 Nov 26, 2022
Embrace the APIs of the future. Hug aims to make developing APIs as simple as possible, but no simpler.

Read Latest Documentation - Browse GitHub Code Repository hug aims to make developing Python driven APIs as simple as possible, but no simpler. As a r

Hug API Framework 6.7k Dec 27, 2022
Little Library API REST

Little Library API REST py 3.10 The only one requeriment it's to have Flask installed.

Luis Quiñones Requelme 1 Dec 15, 2021
Built on Django Rest Framework, to provide with command execution on linux terminal

Built on Django Rest Framework, to provide with command execution on linux terminal

1 Oct 31, 2021
A lightweight REST miniframework for Python.

restless A lightweight REST miniframework for Python. Documentation is at https://restless.readthedocs.io/. Works great with Django, Flask, Pyramid, T

Daniel Lindsley 824 Nov 20, 2022
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

2.4k Dec 24, 2022
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 01, 2023
Mlflow-rest-client - Python client for MLflow REST API

Python Client for MLflow Python client for MLflow REST API. Features: Minimal de

MTS 35 Dec 23, 2022
Authentication Module for django rest auth

django-rest-knox Authentication Module for django rest auth Knox provides easy to use authentication for Django REST Framework The aim is to allow for

James McMahon 873 Dec 30, 2022
Build a Backend REST API with Python & Django

Build a Backend REST API with Python & Django Skills Python Django djangorestframework Aws Git Use the below Git commands in the Windows Command Promp

JeonSoohyun a.k.a Edoc.. 1 Jan 25, 2022
Async Python 3.6+ web server/framework | Build fast. Run fast.

Sanic | Build fast. Run fast. Build Docs Package Support Stats Sanic is a Python 3.6+ web server and web framework that's written to go fast. It allow

Sanic Community Organization 16.7k Dec 28, 2022
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

Jeff Knupp 1.9k Jan 07, 2023
simple api build with django rest framework

Django Rest API django-rest-framework Employees management simple API in this project wrote test suites for endpoints wrote simple doc string for clas

OMAR.A 1 Mar 31, 2022
Key-Value база данных на Tarantool и REST API к ней.

KVmail Key-Value база данных на Tarantool и REST API к ней. Документация к API доступна здесь. Requiremrnts ubuntu 16.04+ python3.6+ supervisord nginx

1 Jun 16, 2021