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
Django-rest-auth provides a set of REST API endpoints for Authentication and Registration

This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST

Tivix 2.4k Dec 29, 2022
A light REST library for Django.

django-nap Read The Docs: https://django-nap.readthedocs.io/en/latest/ Change log: https://django-nap.readthedocs.io/en/latest/changelog.html An API l

Curtis Maloney 223 Dec 07, 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
A Django api to display items and their current up-to-date prices from different online retailers in one platform.

A Django api to display items and their current up-to-date prices from different online retailers in one platform. Utilizing scrapy to periodically scrape the latest prices from different online reta

Kennedy Ngugi Mwaura 1 Nov 05, 2021
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
Dropdown population implementation for Django REST Framework

drf-dropdown Dropdown population implementation for Django REST Framework Usage Add DropdownView to API URL # urls.py import dropdown urlpatterns = [

Preeti Yuankrathok 4 Dec 06, 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
Swagger Documentation Generator for Django REST Framework: deprecated

Django REST Swagger: deprecated (2019-06-04) This project is no longer being maintained. Please consider drf-yasg as an alternative/successor. I haven

Marc Gibbons 2.6k Dec 23, 2022
DSpace REST API Client Library

DSpace Python REST Client Library This client library allows Python 3 scripts (Python 2 probably compatible but not officially supported) to interact

The Library Code GmbH 10 Nov 21, 2022
Simplified REST API to get stickers from Snap

Snap Sticker kit REST API Simplified REST API to get stickers from Snap 💻 Instructions Search stickers Request: url = "https://sticker-kit-horizon733

Dishant Gandhi 1 Jan 05, 2022
One package to access multiple different data sources through their respective API platforms.

BESTLab Platform One package to access multiple different data sources through their respective API platforms. Usage HOBO Platform See hobo_example.py

Wei 1 Nov 16, 2021
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
Creating delicious APIs for Django apps since 2010.

django-tastypie Creating delicious APIs for Django apps since 2010. Currently in beta but being used actively in production on several sites. Requirem

3.8k Dec 30, 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
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
A minimalistic manga reader for desktop built with React and Django

smanga A minimalistic manga reader/server for serving local manga images on desktop browser. Provides a two-page view layout just as reading a physica

Padam Upreti 13 Sep 24, 2022
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
Introduction to Django Rest Framework

Introduction to Django Rest Framework This is the repository of the video series Introduction to Django Rest Framework published on YouTube. It is a s

Simple is Better Than Complex 20 Jul 14, 2022
Extensions for Django REST Framework

Extensions for Django REST Framework

aiden 6 Dec 27, 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