This is a test version of Biostars. For the public version, visit https://www.biostars.org.
NCBI E-utilities API function esearch not working

Hi there. I have a old code to retrieve xml of a SRX using NCBI E-utilities API. For example, using the url as below (you can remove api_key part)

https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=sra&retmax=10000&term=ERX2021050&api_key=blablablabla

I am pretty sure it works in the past. But now it pops error saying the url doesn't work. I checked NCBI E-util books but did not find answer. Any suggestion?

Thanks

ncbi

Working for me

<eSearchResult>
<Count>1</Count>
<RetMax>1</RetMax>
<RetStart>0</RetStart>
<IdList>
<Id>4071266</Id>
</IdList>
<TranslationSet/>
<TranslationStack>
<TermSet>
<Term>ERX2021050[All Fields]</Term>
<Field>All Fields</Field>
<Count>1</Count>
<Explode>N</Explode>
</TermSet>
<OP>GROUP</OP>
</TranslationStack>
<QueryTranslation>ERX2021050[All Fields]</QueryTranslation>
</eSearchResult>

This is actually what I get and it doesn't have any style information. It suppose to have much more fields

it doesn't have any style information

what do you mean ?

1 answer

The NCBI doesn't work like that.

First you use esearch to get a list of identifiers : here you have only one identifier

(...)
<IdList>
<Id>4071266</Id>
</IdList>
(...)

and then use efetch with this/those identifier(s).

https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=sra&id=4071266

Thank you. I misinterpret it. The error is actually due to the default SSL/TLS protocolType change in my code. Now it's working.

Log in to answer this question.