text: user8601: I keep getting a "too many requests error" when querying the NCBI SRA database, even though I'm running less than 10 requests per second, and I have an API key, which supposedly should allow me to run 10 per second.
  Here is my (Python) code:
  import subprocess
  import concurrent.futures
  import time
  
  bioprojects = [
      "PRJNA644722",
      "PRJNA644892"
  ]
  
  all_metadata_generators = []
  
  def fetch_metadata(bioproject):
      return subprocess.run(f"esearch -db sra -query '{bioproject}[bioproject]' | efetch -format runinfo", shell=True, capture_output=True, text=True)
  
  with concurrent.futures.ThreadPoolExecutor() as executor:
      for i in range(0, len(bioprojects), 10):
          all_metadata_generators.append(executor.map(fetch_metadata, bioprojects[i:i+10]))
          time.sleep(1)
  
  
  for metadata_generator in all_metadata_generators:
      for metadata in metadata_generator:
          print(metadata)
  
  
  
  user3577: The execution of your EDirect commands may be limited unless you are using an API Key, which you can create from your MyNCBI account. Your API Key can be used in one of several different ways.
  In an argument to an EDirect command:
  esearch -db nuccore -query 'some query' -api_key 12345
  
  In a UNIX environment:
  You can either run this just before you are running some edirect commands or add the following line to your .bashrc file.
  export NCBI_API_KEY=12345
  
  In the environment, from a Perl script:
  $ENV{NCBI_API_KEY} = "12345"
  
  
original_text: 8601: <p>I keep getting a &quot;too many requests error&quot; when querying the NCBI SRA database, even though I'm running less than 10 requests per second, and I have an API key, which supposedly should allow me to run 10 per second.</p>
  <p>Here is my (Python) code:</p>
  <pre><code>import subprocess
  import concurrent.futures
  import time
  
  bioprojects = [
      &quot;PRJNA644722&quot;,
      &quot;PRJNA644892&quot;
  ]
  
  all_metadata_generators = []
  
  def fetch_metadata(bioproject):
      return subprocess.run(f&quot;esearch -db sra -query '{bioproject}[bioproject]' | efetch -format runinfo&quot;, shell=True, capture_output=True, text=True)
  
  with concurrent.futures.ThreadPoolExecutor() as executor:
      for i in range(0, len(bioprojects), 10):
          all_metadata_generators.append(executor.map(fetch_metadata, bioprojects[i:i+10]))
          time.sleep(1)
  
  
  for metadata_generator in all_metadata_generators:
      for metadata in metadata_generator:
          print(metadata)
  
  </code></pre>
   3577: <p>The execution of your EDirect commands may be limited unless you are using an API Key, which you can create from your MyNCBI account. Your API Key can be used in one of several different ways.</p>
  <p><strong>In an argument to an EDirect command:</strong></p>
  <pre><code>esearch -db nuccore -query 'some query' -api_key 12345
  </code></pre>
  <p><strong>In a UNIX environment:</strong></p>
  <p>You can either run this just before you are running some edirect commands or add the following line to your <code>.bashrc</code> file.</p>
  <pre><code>export NCBI_API_KEY=12345
  </code></pre>
  <p><strong>In the environment, from a Perl script:</strong></p>
  <pre><code>$ENV{NCBI_API_KEY} = &quot;12345&quot;
  </code></pre>
  