1

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 Answers1

1

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

adlopez15
  • 3,449
  • 2
  • 14
  • 19