Notion Answers

Get help from other Notion users


Register & Ask

It's free & easy

Get answers

Answers, votes & comments

Vote and select answers

Receive points, vote and give the solution

Question

1vote

Notion API is retrieving old data

Is there any problem with the Notion API or is it failing?

I wanted to try some code that I programmed few weeks ago and it worked well and now it does not work. Also, it does not recognize any changes that I made. Let me show you an example.

Before
After

The code I am using for this is:

def queryWithFilter():
    url = f'https://api.notion.com/v1/databases/{database_id}/query'
    filters = {
        "page_size": 100,
        "filter": {
            "or": [
                {
                    "property": "title",
                    "rich_text": {
                        "contains": "The One Thing"
                    }
                }
            ]
        }
    }
    headers={
            "Authorization": f"Bearer {token}",
            "Notion-Version": "2021-05-13",
            "Content-Type": "application/json"
    }
    r = requests.post(url, json=filters, headers=headers)
    res = r.json()
    print(res)

Is there anything that maybe I am doing wrong? This code worked amazing few weeks ago.

1 Answer

0vote

polle Points22890

No problems with the API at this time.

I believe it is the cache, time to read the new values or rate limits. Unfortunately it is impossible for someone else to test unless they have everything exactly as you have in your setup.

It may help:
Wait 5 minutes to see if it shows the correct data. If that it the case, then it is the cache and time to sync.
Check the rate limit I linked, maybe that is the case.

Hope that helps.

0vote

GCancino commented

Yup, I tried waiting like around 24 hours or something to make a new request and I am getting the same old results -> Image

I tried with Postman and got the same. I'll try with cURL to see what happens.
But I am not doing anything fancy. Just a query request without filters.

0vote

polle commented

The only thing I can recommend is to reset Notion so it loads everything again from scratch, because the API is not having problems.

Hope that helps.

Please log in or register to answer this question.

Exclusive for Notion Answers Users

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect