News for hackers. Stuff that matters.
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by kjksf on Monday January 14, 2019 @03:52PM (#18906344)
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...

Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by rrix2 on Monday January 14, 2019 @04:48PM (#18906853)
Yikes, they don't have an official API? Hardly interested in making a closed system my "central source of truth"
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by kjksf on Monday January 14, 2019 @04:50PM (#18906878)
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by csytan on Tuesday January 15, 2019 @11:51AM (#18912524)
Also, it's easy to export your entire workspace as raw data. Markup files, images, etc.
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by bohinjc on Wednesday January 16, 2019 @03:59AM (#18919276)
Problem is that the export does not preserve node nesting, which is a problem for an outliner
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by sivakon on Tuesday January 15, 2019 @06:11PM (#18916592)
They don’t work as well with all the latex math.
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by coldtea on Tuesday January 15, 2019 @12:21PM (#18912842)
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.

Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by gorkemcetin on Monday January 14, 2019 @09:58PM (#18908545)
That is because few people really care and aware of it.
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by traviscline on Tuesday January 15, 2019 @10:25AM (#18911760)
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
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by penagwin on Monday January 14, 2019 @10:26PM (#18908653)
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!
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by qbaqbaqba on Tuesday January 15, 2019 @05:36AM (#18910176)
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?
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by ccorcos on Monday January 14, 2019 @04:59PM (#18906934)
Nice job! How do you keep your login token fresh?
Re:Notion – All-in-one workspace for notes, tasks, wikis, an... by kjksf on Monday January 14, 2019 @05:17PM (#18907066)
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.