Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just in case someone might need it: I reverse engineered their API and wrote (an unofficial) client for accessing the data: https://github.com/kjk/notionapi

It's for Go but one could easily port it to any other language. It's just HTTP requests and some light processing of JSON responses.

I use it so that I can have my blog content in Notion. In a daily cron job I download the data from Notion, convert it to HTML and publish on Netlify as a static website. This script is open source: https://github.com/kjk/blog

Basically I use Notion as CMS.

I described my reverse-engineering process in https://blog.kowalczyk.info/article/88aee8f43620471aa9dbcad2...



Yikes, they don't have an official API? Hardly interested in making a closed system my "central source of truth"



Also, it's easy to export your entire workspace as raw data. Markup files, images, etc.


Problem is that the export does not preserve node nesting, which is a problem for an outliner


They don’t work as well with all the latex math.


The data is the "source of truth" and those can be exported, backed up, etc, easily.

Whether there's a programmatic API or not, that's another matter entirely.


That is because few people really care and aware of it.


I used this library for inspiration and extended to write some cli tools for use from vim: https://github.com/tmc/notion/tree/master/cmd


Aw this is perfect! I've been using notion and have always wished they had an api for this exact purpose! Thanks for sharing this!


Are you sure you want to invest into something that requires you to depend on some third party hack to do what you want it to do?


Nice job! How do you keep your login token fresh?


I don't.

When used on publicly visible pages, there's no need for login token.

For private pages, the user would have to provide a new login token when it expired.

It only happened once in several months for me.

I'm hoping that my library will become obsolete when they have an official API.

I talked with them and gave them my wishlist for what capabilities the official API should have.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: