notion-py icon indicating copy to clipboard operation
notion-py copied to clipboard

429 Too Many Requests Error

Open py0zz1 opened this issue 4 years ago • 8 comments

Requesting a certain amount of 'loadpagechunk' will result in '429 Too Many Requests Error'.

It didn't happen before, but this error has occurred since recently.

py0zz1 avatar Mar 08 '21 05:03 py0zz1

I'm having the same error, even when loading only a few blocks of content. I've been able to (sort of) work around this with:

import time
import notion

def do_notion_stuff():
     try:
          # Actions that use loadpagechunk
     catch Exception as e:
          print(e)
          time.sleep(10)
          do_notion_stuff()

However, this results in extremely slow load times for most programs, so a fix would be great.

isaackrementsov avatar Mar 09 '21 16:03 isaackrementsov

I found an API that can replace 'loadPageChunk'.

def getPageMap(blockId): #blockId => 12345678-1234-1234-1234-123456789012
    param = {
        "requests":[
            {
                "table":"block",
                "id":blockId, 
                "version": -1
            }
        ]
    }
    res = client.post("syncRecordValues",param).json()

    return res["recordMap"]["block"][blockId]["value"] # == client.get_block().get()

'syncRecordValues' also has a 429 Error, but is less restrictive than 'loadPageChunk'.

py0zz1 avatar Mar 12 '21 05:03 py0zz1

I'm currently experiencing the exact same issue. Any idea how to fix this? :)

alaedinebe avatar Jun 15 '21 18:06 alaedinebe

I'm also getting this error when trying to init a client using my email and password.

requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://www.notion.so/api/v3/loginWithEmail

sebastian-softedge avatar Aug 25 '21 11:08 sebastian-softedge

I'm getting this error when importing the records from md files to notion.

RankoWong avatar Aug 01 '22 12:08 RankoWong

I am getting this err too requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://www.notion.so/api/v3/loadUserContent

Eikosa avatar Jan 10 '23 20:01 Eikosa

I solved it by putting a time.sleep(5). It doesn't work perfectly, but enough to make use of the algorithm.

Le mar. 10 janv. 2023 à 21:34, Eikosa @.***> a écrit :

I am getting this err too requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://www.notion.so/api/v3/loadUserContent

— Reply to this email directly, view it on GitHub https://github.com/jamalex/notion-py/issues/296#issuecomment-1377813772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOQG63D2EWNCFF4HXFFKOTWRXBUBANCNFSM4YYX3PQA . You are receiving this because you commented.Message ID: @.***>

alaedinebe avatar Jan 21 '23 19:01 alaedinebe

Is there some place where api/v3 is described? Actually, this one /api/v3/loginWithEmail Because i'm getting 403

AntonMelnykAA avatar Jan 25 '23 11:01 AntonMelnykAA