Hey, I'm doing a project which includes data mining but for that I want to build a crawler which extract pubmed articles ids using a single term like cancer or tumor? (semantics based ) I'm currently working in python. If someone is familiar with this issue kindly help me
cancer as a search term.
from Bio import Entrez Entrez.email = "firstname.lastname@example.org" handle = Entrez.esearch(db="pubmed", term="cancer", retmax="10", sort="relevance", retmode="xml") records = Entrez.read(handle) print(records["IdList"])
You can also try out Annotations API from Europe PMC. It allows you to retrieve a list of PMIDs for artciles that contain text-mined terms. Diseases (including cancer or tumor) is one of the annotation types. So for retrieving article iDs for cancer you could use the following response URL: https://www.ebi.ac.uk/europepmc/annotations_api/annotationsByEntity?entity=cancer&filter=1&format=ID_LIST&pageSize=4