Back to APIs list

Notion API examples & templates

Use these vals as a playground to view and fork Notion API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
everyMonday
andreterron
everyMonday
Every Monday Prints every monday between 2 dates. I use it for quarterly planning. The output can be pasted in Notion as a bullet list.
dateMeNotionDatabase
stevekrouse
dateMeNotionDatabase
An interactive, runnable TypeScript val by stevekrouse
date_me_docs_cache
stevekrouse
date_me_docs_cache
An interactive, runnable TypeScript val by stevekrouse
blogRSS
stevekrouse
blogRSS
Val Town Blog RSS Feed View live at: https://stevekrouse-blogRSS.web.val.run This val returns an RSS feed of the Val Town Blog . Architecture Fetch and parse the HTML of https://blog.val.town – @stevekrouse.valTownBlogJSON. Create an RSS string out of that array of blog objects – @stevekrouse.valTownBlogRSS. Expose an endpoint that returns that RSS , with appropriate content-type and cache headers – this val, @stevekrouse.blogRSS Notes This is very inefficient. It refetches and re-parses blog.val.town on every single request, modulo some caching via the headers. It would be much more efficient to cache the results of fetching and parsing the Val Town blog, and then only re-fetch it every 10 minutes or so. Instead of fetching and parsing HTML from super.so, we could get this same data from Notion's API, with a val like @stevekrouse.notionGetDatabase.
getAllNotionDbRows
supersayan
getAllNotionDbRows
Get All Rows of a Database in Notion Reference: Query a Database How to get an access token: https://developers.notion.com/reference/create-a-token
notionDateMeDocNotify3
stevekrouse
notionDateMeDocNotify3
An interactive, runnable TypeScript val by stevekrouse
notionDateDocTruncated
stevekrouse
notionDateDocTruncated
An interactive, runnable TypeScript val by stevekrouse
notionGetDatabaseEditedAfter
stevekrouse
notionGetDatabaseEditedAfter
An interactive, runnable TypeScript val by stevekrouse
dateMeDocs
stevekrouse
dateMeDocs
An interactive, runnable TypeScript val by stevekrouse
getNotionDateMeDocs
stevekrouse
getNotionDateMeDocs
An interactive, runnable TypeScript val by stevekrouse
notionValLinkTweet
stevekrouse
notionValLinkTweet
An interactive, runnable TypeScript val by stevekrouse
valTownBlogJSON
stevekrouse
valTownBlogJSON
Back when our blog was hosted on Notion & Super, this val would parse the blog's HTML and turn it into JSON, which would in turn be transformed into an RSS feed. Now our blog is on Astro and generates an RSS feed automatically: https://blog.val.town/rss.xml
setDatabaseFieldValue
vinspee
setDatabaseFieldValue
An interactive, runnable TypeScript val by vinspee
redirect
thomasatflexos
redirect
This is a handler for when Notion redirects during OAuth 2.0 workflow
notionDateMeDocNotify
stevekrouse
notionDateMeDocNotify
An interactive, runnable TypeScript val by stevekrouse
notionWordCounterFetchDays
andreterron
notionWordCounterFetchDays
An interactive, runnable TypeScript val by andreterron