Python, Notion.Get relational tables data

Viewed 150

I try to get notion table data, but the relational table returns only the ID of the page, without the actual data. How to get data using relation ID?

databaseId ='my_database_id'
headers = {
    "Authorization": "Bearer " + token,
    "Content-Type": "application/json",
    "Notion-Version": "2021-05-13"
}
def readDatabase(databaseId, headers):
    readUrl = f"https://api.notion.com/v1/databases/{databaseId}/query"
    res = requests.request("POST", readUrl, headers=headers)
    data = res.json()
    print(res.text)
1 Answers

The relation ID is a page ID. You can query the information using the GET /pages endpoint or the [GET /blocks endpoint][1]

Related