Visit the main Crossref website

Crossref

Crossref API questions - test queries (example)

Submitted by: Ingram Weber, Jan 15

Dear Crossref Support,

Last year I asked if Crossref permitted Boolean searching. In the response below, it was mentioned that work was going on to improve the search function. I was just wondering if this new code was released yet and if it permitted Boolean searching. I ask because when I search for two terms (e.g. “sunlight and eyesight”), I find it strange that the first few results (the ones marked as most relevant) are missing one of those terms.

Thank you for your continued assistance.

Kind regards,

Ingram


Isaac Farley , Crossref support, responded Jan 16 09:36

Hi Ingram,

Thanks for letting us know. I’ve added your request to an existing GitHub issue: https://github.com/CrossRef/rest-api-doc/issues/135. As you can see, you are not the first to request the Boolean functionality.

The team will be taking a look at this soon, but please note we’re currently migrating the REST API from a Solr to ElasticSearch database. This is a large job, but it’s needed to scale the REST API, speed up deployment of new features in the future, and resolve eccentricities in the data model due to Solr’s constraints. While this is happening we’ve paused work on the REST API, including non-critical bugs and new features. This is to ensure a smooth cutover so that users don’t experience any disruption to the service.

We’re really sorry about the inconvenience, but this work is essential to making the REST API more robust and efficient. We’ll be in touch as soon as the migration is complete with more information on your request.

Thanks again,
Isaac

Isaac Farley
Crossref Technical Support Manager
@CrossrefSupport

Keep up to date with service performance, incidents, and planned maintenance at status.crossref.org


Ingram Weber, responded Jan 27 08:15

Hi Isaac,

I have an additional question if you don’t mind. Is it possible to use the API to search across multiple publication types at the same time? For example, I would like to search across “journal-articles”, “book chapters”, “monographs”, “reports” and “working papers”. I understand that I can write my api call to state: ‘filter’:‘type:journal-article’ , but how can I search for all of the other types at the same time? Thank you.


Ingram Weber, responded Jan 27 18:44

Hi Isaac,

Apologies for the multiple emails. I have the same question below regarding publications. Specifically, could I identify a list of, say, 10 publications, and then do a search for terms across only those 10 publications? If so, how could I do that API query? Thank you very much.


Isaac Farley , Crossref support, responded Jan 28 20:50

Hi Ingram,

Thanks for your request. Can you provide me more information on what you’d want to be searching for across content types like that? The API does provide a score for matching, so while it does not permit Boolean operators, if you provide it with many search terms and/or filters you will increase the number of results, but the results will be ordered by most relevant (or, the highest scoring matches based on your search criteria).

Looking forward to hearing from you,
Isaac


Ingram Weber, responded Jan 29 08:19

Hi Isaac,

To clarify, I really have two questions.

First

I would like to know if I can write an API query to search across several publication types. For example, let’s say I want to search with the query “economic sanctions human rights”. As I understand it, Crossref has nearly 30 different content types I could search in. But I only want to see results from “journal-article”, “monograph”, “report” and “dissertation”. I do NOT want to receive results from “reference” or “dataset”. Now, I can write an API call with the following parameter: ‘filter’:‘type:journal-article’. Is it possible to write this API call so it searches “monograph”, “report” and “dissertation” as well? If so, how would I write that call?

Second

I would like to know if I can write an API query that searches specific publications. Again, let’s say I want to search with the query “economic sanctions human rights”, but I only want to look in, say, 5 specific sources like, “World Bank Economic Review” or “Journal of Economic Research”, etc. How would I write an API call that searches for my query across a few specific publications? If this is possible, is there a limit to how many specific publications I can search across with an API call?

Please let me know if you have any questions. Thank you very much.

Ingram


Isaac Farley , Crossref support, responded Jan 30 12:30

Hi Ingram,

Thanks for clarifying your questions. I was able to spend some time this morning with your request, and I have answers.

The first query you are trying to perform where you are only searching in specific content-types is possible.

To start, I queried all of our works and faceted the results by content-type, so I could get an idea of how many results were being returned for each content type: https://api.crossref.org/works?query=economic+sanctions+human+rights&facet=type-name:*

I then wanted to only see those results which were journal articles, dissertations, and monographs: https://api.crossref.org/works?query=economic+sanctions+human+rights&filter=type:journal-article,type:dissertation,type:monograph

You could add a “,type:report” to my query to get exactly what you asked for in your first question.

As a reminder, the API is going to return results for any journal article, dissertation, and monograph with any of those words: economic, sanctions, human, or rights in the metadata, which makes for very large returns. But, the results are ordered with the most matches sorted the highest (or, with the highest score).

The second query requires a little more piecemealing to get everything you want, since we cannot search across multiple journals simultaneously. That said, if you have the ISSNs for the journals you’d like to search within, you can run individualized queries by simply replacing the ISSN in my call with other ISSNs:

http://api.crossref.org/journals/02586770/works?query=economic+sanctions+human+rights - this gives me all the works within the World Bank Economic Review (ISSN 02586770) with the words economic, sanctions, human, or rights in the metadata. Again, the results are in order of relevance.

I hope this helps.

Please let me know if you have any additional questions.

Best,
Isaac


Ingram Weber, responded Jan 30 17:12

Hi Isaac,

This is extremely helpful! Thank you very much!

The boolean searching we discussed earlier will be especially helpful when it comes out, but in the meantime this is great.

Thanks so much again,

Ingram