I'm trying to get some data using the NCBI API. I am using requests
to make the connection to the API.
What I'm stuck on is how do I convert the XML object that requests returns into something that I can parse?
Here's my code for the function so far:
def getNCBIid(speciesName):
import requests
base_url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/"
url = base_url + "esearch.fcgi?db=assembly&term=(%s[All Fields])&usehistory=y&api_key=f1e800ad255b055a691c7cf57a576fe4da08" % speciesName
#xml object
api_request = requests.get(url)