4 ms·
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 htt
by kjksf 8y ago
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 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 https://github.com/kjk/blog
Basically I use Notion as CMS.
I described my reverse-engineering process in https://blog.kowalczyk.info/article/88aee8f43620471aa9dbcad28368174c/how-i-reverse-engineered-notion-api.html https://blog.kowalczyk.info/article/88aee8f43620471aa9dbcad2...
- rrix2 8y agoYikes, they don't have an official API? Hardly interested in making a closed system my "central source of truth"
- kjksf 8y agoOfficial API is on their roadmap: https://www.notion.so/What-s-New-157765353f2c4705bd45474e5ba8b46c https://www.notion.so/What-s-New-157765353f2c4705bd45474e5ba...
- gorkemcetin 8y agoThat is because few people really care and aware of it.
- coldtea 8y agoThe 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.
- ccorcos 8y agoNice job! How do you keep your login token fresh?
- kjksf 8y agoI 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.
- penagwin 8y agoAw this is perfect! I've been using notion and have always wished they had an api for this exact purpose! Thanks for sharing this!
- qbaqbaqba 8y agoAre 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?
- traviscline 8y agoI used this library for inspiration and extended to write some cli tools for use from vim: https://github.com/tmc/notion/tree/master/cmd https://github.com/tmc/notion/tree/master/cmd