Closed BenBlumer closed 4 years ago
Notion has a Markdown export feature, though I've never used it so I can't say what sort of quality it has.
Have you tried using that already?
Yeah - it works. I'm looking for a way to access that programmitically.
If you're curious: I'm writing a piece of code to monitor changes in notion docs and trigger an export to MD, Which I then convert to ODT and upload to google docs. And vice versa. The idea is to keep Google docs synched with Notion and vice versa.
Notion has a Markdown export feature, though I've never used it so I can't say what sort of quality it has.
Have you tried using that already?
Oh I see... I feel like I recall there being an API endpoint for this. I don't see any in notion-py
but after looking at the API calls from the web client it looks like there's a way to at least call it programmatically.
There's an enqueueTask
endpoint that begins the export with the payload shown
and then there's a getTasks
endpoint that allows you to get the final output. The result is in the payload
If you want to see this and tinker with it yourself, you can open the Notion web client in Chrome, open the network tab, and then do an export.
For those who find this ticket googling "notion to markdown" export: Gist to export blog post using notion-py https://gist.github.com/AlexMikhalev/8c8ff3b7d657a106b39a1038715aa56b
Thanks for the package! I'm hoping someone here will have insight: What's the best way to programmatically export notion pages as markdown?