<p>Which accessions are you trying to get to? In the page you refer to, there is an option to download the list of accessions - one SRR run accession per line - by clicking the 'Accessions' button or the entire table by clicking the 'Metadata' button as highlighted in the screenshot below:
<a href="https://i.sstatic.net/TI7xh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TI7xh.png" alt="enter image description here" /></a></p>
<p>You can get the same data from the command line using the <a href="https://www.ncbi.nlm.nih.gov/books/NBK179288/" rel="nofollow noreferrer">Entrez Direct</a>. The command for that would be something like:</p>
<pre><code>esearch -db sra -query 'PRJNA491191[bioproject]' | efetch -format runinfo
</code></pre>
<p>to download the table in CSV format.</p>

CC BY-SA 4.0
2020-07-09T00:43:39.897Z
2020-07-09T00:43:39.897Z
vkkodali
<p>I would like to programmatically retrieve the file &quot;Accession List&quot; from an <a href="https://www.ncbi.nlm.nih.gov/Traces/study/?acc=PRJNA491191&amp;o=acc_s%3Aa" rel="nofollow noreferrer">NCBI page</a>.</p>
<p>I'm running firefox, so I'm clicking the file and clicking <code>Ctrl</code> + <code>Shift</code> + <code>E</code> to try and figure out what the file endpoint is. But I can't seem to figure it out (I haven't done this much, I just remember doing it once for a previous project).</p>
<p>When I do this, I see two links popping up on my screen, as shown below:</p>
<p><a href="https://i.sstatic.net/UY0oy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/UY0oy.png" alt="enter image description here" /></a></p>
<p>I see that the first one has a field (I'm talking about the panel on the right) called &quot;acc&quot;, which varies from one data dump to the next, so I'm presuming this is the link I need to use to retrieve the file (though I'm not sure), and just change the &quot;acc&quot; field depending on the data I want. Assuming this is right, I'm not sure how to go from here.
I've included the text on the right below for clarity.</p>
<pre><code>GET
    https://www.google-analytics.com/collect?v=1&amp;_v=j83&amp;a=1402353855&amp;t=event&amp;_s=4&amp;dl=https://www.ncbi.nlm.nih.gov/Traces/study/?acc=PRJNA491191&amp;o=acc_s%3Aa&amp;ul=en-us&amp;de=UTF-8&amp;dt=Run Selector :: NCBI&amp;sd=24-bit&amp;sr=1280x720&amp;vp=1232x601&amp;je=0&amp;ec=Link Click&amp;ea=Metadata  &amp;el=NONE&amp;_u=SACAAEAB~&amp;jid=&amp;gjid=&amp;cid=1350895533.1590937485&amp;tid=UA-68648221-3&amp;_gid=391407234.1594002343&amp;cd1=run_selector&amp;cd2=sra&amp;cd3=&amp;cd5=NO&amp;cd6=run_selector:sra:&amp;cd8=&amp;cd9=&amp;cd10=&amp;cd11=&amp;cd12=&amp;cd13=&amp;cd14=&amp;cd15=&amp;cd16=&amp;cg1=run_selector&amp;cg2=sra&amp;cg3=&amp;cg4=run_selector:sra:&amp;z=508671370

</code></pre>

<phylogenetics>
Programmatically retrieve Accession List from NCBI
# Programmatically retrieve Accession List from NCBI

(Asked by: username_0 on 2020-07-08)

I would like to programmatically retrieve the file "Accession List" from an NCBI page.
I'm running firefox, so I'm clicking the file and clicking Ctrl + Shift + E to try and figure out what the file endpoint is. But I can't seem to figure it out (I haven't done this much, I just remember doing it once for a previous project).
When I do this, I see two links popping up on my screen, as shown below:

I see that the first one has a field (I'm talking about the panel on the right) called "acc", which varies from one data dump to the next, so I'm presuming this is the link I need to use to retrieve the file (though I'm not sure), and just change the "acc" field depending on the data I want. Assuming this is right, I'm not sure how to go from here.
I've included the text on the right below for clarity.
GET
    https://www.google-analytics.com/collect?v=1&_v=j83&a=1402353855&t=event&_s=4&dl=https://www.ncbi.nlm.nih.gov/Traces/study/?acc=PRJNA491191&o=acc_s%3Aa&ul=en-us&de=UTF-8&dt=Run Selector :: NCBI&sd=24-bit&sr=1280x720&vp=1232x601&je=0&ec=Link Click&ea=Metadata  ⪙=NONE&_u=SACAAEAB~&jid=&gjid=&cid=1350895533.1590937485&tid=UA-68648221-3&_gid=391407234.1594002343&cd1=run_selector&cd2=sra&cd3=&cd5=NO&cd6=run_selector:sra:&cd8=&cd9=&cd10=&cd11=&cd12=&cd13=&cd14=&cd15=&cd16=&cg1=run_selector&cg2=sra&cg3=&cg4=run_selector:sra:&z=508671370

**Tags:** phylogenetics

---

## 1 answers

### Answer by username_1 on 2020-07-09. Score: 2 | Accepted answer

Which accessions are you trying to get to? In the page you refer to, there is an option to download the list of accessions - one SRR run accession per line - by clicking the 'Accessions' button or the entire table by clicking the 'Metadata' button as highlighted in the screenshot below:

You can get the same data from the command line using the Entrez Direct. The command for that would be something like:
esearch -db sra -query 'PRJNA491191[bioproject]' | efetch -format runinfo

to download the table in CSV format.


---

