I am trying to decode pubmed json output as follows.
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=29753496&retmode=json
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=15674886&retmode=json
How can I extract the doi from this output?
"articleids": [
{
"idtype": "pubmed",
"idtypen": 1,
"value": "15674886"
},
{
"idtype": "doi",
"idtypen": 3,
"value": "10.1002/14651858.CD001801.pub2"
},
{
"idtype": "rid",
"idtypen": 8,
"value": "15674886"
},
{
"idtype": "eid",
"idtypen": 8,
"value": "15674886"
}
],
I was able to extract other details like title, author name etc. But this one seems little tricky.
Sorry if its a silly question.
(articleids.filter(a => a.idtype === 'doi').pop() || {}).value
assuming there is max oneidtype === 'doi'
- Ele