API filter exclude type

Hi! I would like to see if I’m missing something in the documentation - is there an ability to filter to exclude values?

For example, in the following query:

  1. Is there a way to filter for works types other than “grant”?
  2. Is there a way to filter for multiple works types?

/works?filter=type:grant,funder:10.13039/501100011730

Hello, and thanks for your question.

Yes, you can filter by any of our supported work types. The options are as follows:

book-section, monograph, report-component, report, peer-review, book-track, journal-article, book-part, other, book, journal-volume, book-set, reference-entry, proceedings-article, journal, component, book-chapter, proceedings-series, report-series, proceedings, database, standard, reference-book, posted-content, journal-issue, dissertation, grant, dataset, book-series, edited-book

There’s a known issue with the book and book chapter types and subtypes, which is, for example, why book, monograph, edited-book, and reference-book are all separate ‘types’. We hope to improve support and clarification for those in the future.

And you can indicate multiple types, for example, this will return both grants and reports
https://0-api-crossref-org.libus.csd.mu.edu/works?filter=type:grant,type:report

There are some filters that take the values ‘true’ or ‘false’, which do let you exclude items without that feature. For example, has-abstract:false will exclude results with abstracts. Similarly has-orcid:false will exclude results with ORCIDs for authors.

But, otherwise, there’s no way to indicate 'everything but…". So, if you wanted to get all content types except for grants, you would need to specify all the other content types explicitly (filter=type:journal-article, type:book,type:report, etc. etc.).

You can find more details in our API documentation at api.crossref.org

-Shayn

2 Likes