Retrieving DOI from Title, Author and Year

Hi there!

I want to retrieve the DOI for a combination of a title, the first author, and the year. I wanted to use the query method, but there is no date or year filed in it. It also does not allow me to use a title. Here is the example article I want to get its DOI:
title: “The generic name Mediocris (Cetacea: Delphinoidea: Kentriodontidae),
belongs to a foraminiferan”
author : Mark D Uhen
Year: 2006

I tried this but it failed (although I could not find any filed name for the year):

last_name='Uhen'
title = 'The generic nameMediocris (Cetacea: Delphinoidea: Kentriodontidae), belongs to a foraminiferan'

q = works.query(author=last_name, title = title)

Here is the error I got:
UrlSyntaxError: Field query title specified but there is no such field query for this route. Valid field queries for this route are: affiliation, author, bibliographic, chair, container_title, contributor, editor, event_acronym, event_location, event_name, event_sponsor, event_theme, funder_name, publisher_location, publisher_name, translator

I appreciate any help!
Thanks

Hi, and thanks for your post.

There isn’t a field query option for publication date, and we had to remove query.title option in 2019 for technical reasons.

So, if you want to query on title, author, and publication date together, you’ll need to use query.bibliographic combined with query.author. The example in our documentation looks like this

https://0-api-crossref-org.library.alliant.edu/works?query.bibliographic=room+at+the+bottom&query.author=richard+feynman

So, the query for the example item you gave would be
https://0-api-crossref-org.library.alliant.edu/works?query.bibliographic=The+generic+name+Mediocris+(Cetacea:+Delphinoidea:+Kentriodontidae),+belongs+to+a+foraminiferan+2006&query.author=Mark+D+Uhen
(the plus signs aren’t necessary; you can leave them as spaces and get the same results)

You can find our full REST API documentation at api.crossref.org

Please let me know if you have any other questions.

-Shayn

1 Like

Thank you, Shayn; it really helped. I have been wondering for a year, can I use the method filter with the method query?

I am using Python to hit the RESTful API. I just do not know how can I combine the filter method with the query method.
Here is what I have:

last_name='Uhen'
title = 'The+generic+name'
#filter=from-pub-date:2008-08-13,until-pub-date:2008-08-13
q = works.query(author=last_name,bibliographic=title)
print(q.url)

Would you please let me know how I can combine the filter with the query?
Thank you
Noushin

Hi Noushin,

You can combine filters with the field queries. For example, if I wanted to modify the example query I showed previously to include the from-pub-date and until-pub-date filters, so that the results include only items with a publication date (either print or online) in 2006, that would look like this:
https://0-api-crossref-org.library.alliant.edu/works?filter=from-pub-date:2006-01-01,until-pub-date:2006-12-31&query.bibliographic=The+generic+name+Mediocris+(Cetacea:+Delphinoidea:+Kentriodontidae),+belongs+to+a+foraminiferan+2006&query.author=Mark+D+Uhen

Unfortunately, I can’t advise what that should look like in your Python script. But, perhaps another user will come across this post and share their expertise.

Best,
Shayn

2 Likes

Thank you so much.
Noushin