This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Search Pubmed by Pubmed API

Hi,

I am using pubmed API to return some papers. My code is this:

def search(query):
    Entrez.email = 'z.poorbahman1@fooo.bar'
    handle = Entrez.esearch(db='pubmed',
                            usehistory = 'y',
                            sort='relevance',
                            retmax=str(_num),
                            retmode='xml',
                            datetype='pdat',
                            mindate='2014',
                            maxdate='2019',
                            term=query)
    results = Entrez.read(handle)
    return results

def fetch_details(id_list):
    ids = ','.join(id_list)
    Entrez.email = 'z.poorbahman1@foo.bar'
    handle = Entrez.efetch(db='pubmed',
                           retmode='xml',
                           id=ids)
    results = Entrez.read(handle)
    return results

def main():
    result = search("\"Breathing Exercises\"[MeSH Terms] OR \"Coronary Vessels\"[MeSH Terms] OR \"Heart Transplantation\"[MeSH Terms]")
    id_list = results['IdList']
    papers = fetch_details(id_list)

Unfortunately, some returned papers do not have even one of searched mesh terms(Breathing Exercises, Coronary Vessels, Heart Transplantation).

I do not know what the reason is?!

I would appreciate it if you guide me.

Many thanks

assembly

I have abstracted your email address for privacy purposes. Also, you're looking for help with pubmed, eutils in what looks like python code and the only tag you've used is an irrelevant one. Why is that?

Hi, I did not know which tag I should choose. Which tag should I choose? How to change it? I saw a post about pubmed on your website, and I thought that you could help me. Is it possible to get help of you? Regards

0 answers

No answers yet.

Log in to answer this question.