Skip to content

Problems with rate limits #506

Description

Since recently we frequently get "429 Too many requests" errors when we try to request one asset after another, for example for the landsat-c2-l2 collection. Even if I add a delay of 1 second between the requests, I still get an error after ~10-12 requests. This problem only has only been occurring for 1 or 2 weeks.
Was there any change done for rate limits recently? The documentation only says that rate limits should be generous.

Example code:

import requests

search_results = requests.get("https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2/items").json()
product = search_results["features"][0]
for asset in product["assets"].values():
    url = asset["href"]
    sign_url = f"https://planetarycomputer.microsoft.com/api/sas/v1/sign?href={url}"
    print("get", sign_url)
    res = requests.get(sign_url)
    print(res.status_code)
    time.sleep(1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions