Pubmed是全世界最大生物醫學文獻資料庫,想要暸解最新文獻資訊時總會使用Pubmed來獲取資料並且將其彙整,使用Pubmed API的話,可以減少很多人力使用web page收集資料的時間。只要稍微一點http傳輸的概念,搭配相關語言的包(比如常用R的人可以使用httpr包、常用python的人可以使用requests包),可以很輕鬆地獲取想要的資料並且快速整理!
對於R的使用者,就更方便了,目前有RISmed, pubmed.mineR這兩個包,裡面利用Pubmed API來開發的封包,RISmed主要提供下載資料的接口,而pubmed.mineR則更偏重文獻分析的演算法,可參閱他原發表論文裡有提供三個範例。
在pubmed的官網有對於各種API使用的說明和範例, 其中Entrez Programming Utilities提供以下的幫助:
<br />The Entrez Programming Utilities (E-utilities) are a set of eight server-side programs that provide a stable interface into the Entrez query and database system at the National Center for Biotechnology Information (NCBI). The E-utilities use a <strong><span style="color: #ff0000;">fixed URL syntax that translates a standard set of input parameters into the values necessary for various NCBI software components to search for and retrieve the requested data</span></strong>. The E-utilities are therefore the structured interface to the Entrez system, which currently includes 38 databases covering a variety of <strong><span style="color: #ff9900;">biomedical data, including nucleotide and protein sequences, gene records, three-dimensional molecular structures, and the biomedical literature</span></strong>.
他主要使用固定的url字串語法,操作簡單易懂,且在Sample Applicatioins of the E-utilities一章中提供大量的pseudo code以方便理解!
主要有九種utilities提供使用,分別是:EInfo, ESearch, EPost, ESummary, EFetch, ELink, EGQuery, ESpell, ECitMatch。每一個都使用不同的URL作為基礎request字串。
EInfo (database statistics)
eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi
提供NCBI各資料庫的基本統計資料,和與其他資料庫連結的網址。
ESearch (text searches)
eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi
提供用文字搜尋的方式,取得各資料庫中吻合的相關資料UID號碼,可用來繼續於ESummary, EFetch, ELink搜尋使用。
EPost (UID uploads)
eutils.ncbi.nlm.nih.gov/entrez/eutils/epost.fcgi
指定資料UID後,可用來上傳資料
ESummary (document summary downloads)
eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi
指定資料UID,可回傳目標資料的摘要(summary)
EFetch (data record downloads)
eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi
指定資料的UID,可以回傳的資料格式和紀錄
ELink (Entrez links)
eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi
提供UIDs後,可以回傳相關文獻或是資料的UID
EGQuery (global query)
eutils.ncbi.nlm.nih.gov/entrez/eutils/egquery.fcgi
文字索引,取得相關資料庫的entrez 資訊
ESpell (spelling suggestions)
eutils.ncbi.nlm.nih.gov/entrez/eutils/espell.fcgi
取得特定文字索引後,資料庫建議的索引文字
ECitMatch (batch citation searching in PubMed)
eutils.ncbi.nlm.nih.gov/entrez/eutils/ecitmatch.cgi
指定UID後可以查詢相關的引用文件資訊
這邊有可以查詢的所有NCBI database
對「Pubmed API介紹」的一則回應