1

I'm trying to update the page covers of pages in a database. I've tried using notion/search to look for pages but I end up with all pages in the database instead of the typed result. Currently, I'm trying to query a database with filters for property Title and see if it contains the drama name but I'm with a similar result as earlier

url = f"https://api.notion.com/v1/databases/{database_id}/query"
search_data = {
    "filter":{
        "and": [
            {
                "property":"Drama Title",
                "text": {
                    "contains":"example_show"
                }
            }
        ]}
    }      
res = requests.request("POST", url, headers=headers, data=search_data)
page = res.json()
print(page)

The reason to get the page is so I can get its page_id to use notions patch "Update Page" to change the cover of the page.

  • Have you tried doing this without the `and` wrapper (there doesn't seem to be any point in it with only one condition)? Does it have the same result? Also, it might be helpful to post your database's schema (properties) here – Grisha S Feb 08 '22 at 20:27

0 Answers0