Notion API with Python

https://www.notion.so/my-integrations
Page share settings
import requests
import json
import sys
payload = json.dumps({
"children": [
{
"object": "block",
"type": "paragraph",
"paragraph": {
"text": [
{
"type": "text",
"text": {
"content": data, //data is the new block to be added in the page, in my case a new line.
}
}
]
}
}
]
})
response = requests.request("PATCH", url, headers=headers, data=payload)
Notion response
Screenshot from Notion page

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store