saketkc / pysradb

Package for fetching metadata and downloading data from SRA/ENA/GEO
https://saketkc.github.io/pysradb
BSD 3-Clause "New" or "Revised" License
303 stars 49 forks source link

API rate limit #176

Closed josruirod closed 1 year ago

josruirod commented 1 year ago

Description

Thank you for the work. I've been regularly using pysradb from SRPXXXX identifiers to download info I require, with no issues. However, this error has started to happen lately. Guess it'll work again eventually? Any workaround? Thanks for your time

Traceback (most recent call last):
  File "/xxx/bin/pysradb", line 10, in <module>
    sys.exit(parse_args())
             ^^^^^^^^^^^^
  File "/xxx/lib/python3.11/site-packages/pysradb/cli.py", line 1202, in parse_args
    metadata(
  File "xxx/lib/python3.11/site-packages/pysradb/cli.py", line 79, in metadata
    df = sradb.sra_metadata(
         ^^^^^^^^^^^^^^^^^^^
  File "xxx/lib/python3.11/site-packages/pysradb/sraweb.py", line 419, in sra_metadata
    esummary_result = self.get_esummary_response("sra", srp)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xxx/python3.11/site-packages/pysradb/sraweb.py", line 286, in get_esummary_response
    esearch_response = _retry_response(
                       ^^^^^^^^^^^^^^^^
  File "xxx/lib/python3.11/site-packages/pysradb/sraweb.py", line 50, in _retry_response
    raise RuntimeError("Failed to fetch esummary. API rate limit exceeded.")
RuntimeError: Failed to fetch esummary. API rate limit exceeded.
saketkc commented 1 year ago

It should resolve on its own after a time out. But you can pass SRAweb() an api_key (though this is not exposed to the CLI currently): https://github.com/saketkc/pysradb/pull/61/files

Please reopen if the issue persists.