text: user12272: I would like to download a number of SARS-CoV-2 fastas from NCBI/Genbank using a web endpoint. I looked on their website but it's confusing.
  I have the accession numbers, but can't figure out how to use the NCBI/Genbank Entrez API.
  This is how I would do it using cov-spectrum: https://lapis.cov-spectrum.org/open/v1/sample/fasta?genbankAccession=MZ039713,MZ039682,OV522182
  Is there something similar for NCBI/Genbank?
  There must be a way, I just can't figure it out. The whole entrez thing is overwhelming to me, all I want is a simple API, like covSpectrum offers, for example. I scanned this but didn't help: https://www.ncbi.nlm.nih.gov/sars-cov-2/
  E.g. how could I download all these SARS-CoV-2 nucleotide sequences with accession numbers: MZ039713,MZ039682 and OV522182 using a URL?
  Some command line tools are advertised, but I don't want to have to use a CLI tool. Just a simple URL, does that not exist? CLI tools: https://www.ncbi.nlm.nih.gov/datasets/docs/v1/quickstarts/command-line-tools/
  I also don't want to do any clicking through a web interface, just a URL so that other web apps can download it behind the scenes.
  
  user3848: There are three ways to do this,
  
  If you click on this link Your NCBI examples. Its done.
  You would then just click "download"
  Click "next", click "next"
  
  The sequence then downloads.
  Essentially all I did was in the website click on the left hand navigation bar and clicked "accession number" and type in MZ039713 MZ039682 OV522182.
  
  The second way is to go to https://ncbi.nlm.nih.gov/nuccore
  Type type in MZ039713 MZ039682 OV522182
  Click on the "Summary" and click on "Fasta"
  Click on "send to" and click on "File"
  
  I'm not certain is point 3 immediately above is required.
  The final approach is to use efetch to automate the download, but that requires downloading the NCBI's efetch suite, which is then flipped through on a bash loop.
  efetch -db nuccore -id MZ039682 -format fasta
  
  The link for looking to automate is:
  https://www.ncbi.nlm.nih.gov/labs/virus/vssi/#/virus?SeqType_s=Nucleotide&VirusLineage_ss=SARS-CoV-2,%20taxid:2697049&ids=MZ039713%20MZ039682%20OV522182%20
  Just to highlight
  MZ039713%20MZ039682%20OV522182%20
  The API is here, but I don't use them.
  
  user10114: You can get the data from the API of the European Nucleotide Archive (ENA) which is synched with NCBI/GenBank:
  https://www.ebi.ac.uk/ena/browser/api/fasta/MZ039713,MZ039682,OV522182
  
  user15139: You can try the NCBI Datasets API. We have an endpoint that would allow you to download virus sequences by accession  The only thing to be aware (based on your list of accessions) is that our API needs the accession version to return results. In the case of your examples, they would need to be MZ039713.1, MZ039682.1 and OV522182.1.
  I hope this helps!
  
original_text: 12272: <p>I would like to download a number of SARS-CoV-2 fastas from <a href="https://www.ncbi.nlm.nih.gov/sars-cov-2/" rel="nofollow noreferrer">NCBI/Genbank</a> using a web endpoint. I looked on their website but it's confusing.</p>
  <p>I have the accession numbers, but can't figure out how to use the NCBI/Genbank Entrez API.</p>
  <p>This is how I would do it using cov-spectrum: <a href="https://lapis.cov-spectrum.org/open/v1/sample/fasta?genbankAccession=MZ039713,MZ039682,OV522182" rel="nofollow noreferrer">https://lapis.cov-spectrum.org/open/v1/sample/fasta?genbankAccession=MZ039713,MZ039682,OV522182</a></p>
  <p>Is there something similar for NCBI/Genbank?</p>
  <p>There must be a way, I just can't figure it out. The whole entrez thing is overwhelming to me, all I want is a simple API, like covSpectrum offers, for example. I scanned this but didn't help: <a href="https://www.ncbi.nlm.nih.gov/sars-cov-2/" rel="nofollow noreferrer">https://www.ncbi.nlm.nih.gov/sars-cov-2/</a></p>
  <p>E.g. how could I download all these SARS-CoV-2 nucleotide sequences with accession numbers: <code>MZ039713</code>,<code>MZ039682</code> and <code>OV522182</code> using a URL?</p>
  <p>Some command line tools are advertised, but I don't want to have to use a CLI tool. Just a simple URL, does that not exist? CLI tools: <a href="https://www.ncbi.nlm.nih.gov/datasets/docs/v1/quickstarts/command-line-tools/" rel="nofollow noreferrer">https://www.ncbi.nlm.nih.gov/datasets/docs/v1/quickstarts/command-line-tools/</a></p>
  <p>I also don't want to do any clicking through a web interface, just a URL so that other web apps can download it behind the scenes.</p>
   3848: <p>There are three ways to do this,</p>
  <ol>
  <li>If you click on this link <a href="https://www.ncbi.nlm.nih.gov/labs/virus/vssi/#/virus?SeqType_s=Nucleotide&amp;VirusLineage_ss=SARS-CoV-2,%20taxid:2697049&amp;ids=MZ039713%20MZ039682%20OV522182%20" rel="nofollow noreferrer">Your NCBI examples</a>. Its done.</li>
  <li>You would then just click &quot;download&quot;</li>
  <li>Click &quot;next&quot;, click &quot;next&quot;</li>
  </ol>
  <p>The sequence then downloads.</p>
  <p>Essentially all I did was in the website click on the left hand navigation bar and clicked &quot;accession number&quot; and type in <code>MZ039713 MZ039682 OV522182</code>.</p>
  <ol>
  <li>The second way is to go to <a href="https://ncbi.nlm.nih.gov/nuccore" rel="nofollow noreferrer">https://ncbi.nlm.nih.gov/nuccore</a></li>
  <li>Type type in <code>MZ039713 MZ039682 OV522182</code></li>
  <li>Click on the &quot;Summary&quot; and click on &quot;Fasta&quot;</li>
  <li>Click on &quot;send to&quot; and click on &quot;File&quot;</li>
  </ol>
  <p>I'm not certain is point 3 immediately above is required.</p>
  <p>The final approach is to use efetch to automate the download, but that requires downloading the NCBI's efetch suite, which is then flipped through on a bash loop.</p>
  <pre><code>efetch -db nuccore -id MZ039682 -format fasta
  </code></pre>
  <p>The link for looking to automate is:
  <a href="https://www.ncbi.nlm.nih.gov/labs/virus/vssi/#/virus?SeqType_s=Nucleotide&amp;VirusLineage_ss=SARS-CoV-2,%20taxid:2697049&amp;ids=MZ039713%20MZ039682%20OV522182%20" rel="nofollow noreferrer">https://www.ncbi.nlm.nih.gov/labs/virus/vssi/#/virus?SeqType_s=Nucleotide&amp;VirusLineage_ss=SARS-CoV-2,%20taxid:2697049&amp;ids=MZ039713%20MZ039682%20OV522182%20</a></p>
  <p>Just to highlight
  <strong>MZ039713</strong>%20<strong>MZ039682</strong>%20<strong>OV522182%20</strong></p>
  <p>The API is <a href="https://www.ncbi.nlm.nih.gov/home/develop/api/" rel="nofollow noreferrer">here</a>, but I don't use them.</p>
   10114: <p>You can get the data from the API of the European Nucleotide Archive (ENA) which is synched with NCBI/GenBank:</p>
  <p><a href="https://www.ebi.ac.uk/ena/browser/api/fasta/MZ039713,MZ039682,OV522182" rel="nofollow noreferrer">https://www.ebi.ac.uk/ena/browser/api/fasta/MZ039713,MZ039682,OV522182</a></p>
   15139: <p>You can try the <a href="https://www.ncbi.nlm.nih.gov/datasets/docs/v1/reference-docs/rest-api/" rel="nofollow noreferrer">NCBI Datasets API</a>. We have an endpoint that would allow you to download virus sequences by <a href="https://www.ncbi.nlm.nih.gov/datasets/docs/v1/reference-docs/rest-api/#get-/virus/accession/-accessions-/genome/download" rel="nofollow noreferrer">accession</a>  The only thing to be aware (based on your list of accessions) is that our API needs the accession version to return results. In the case of your examples, they would need to be MZ039713.1, MZ039682.1 and OV522182.1.
  I hope this helps!</p>
  