serrano

Build Status codecov.io

serrano is a low level client for Crossref APIs

Docs: http://recology.info/serrano/

Other Crossref API clients:

Changes

For changes see the NEWS file.

API

Methods in relation to Crossref search API routes

  • /works - Serrano.works()
  • /members - Serrano.members()
  • /prefixes - Serrano.prefixes()
  • /funders - Serrano.funders()
  • /journals - Serrano.journals()
  • /licenses - Serrano.licenses()
  • /types - Serrano.types()

Additional methods built on top of the Crossref search API:

  • DOI minting agency - Serrano.agency()
  • Get random DOIs - Serrano.random_dois()

Other methods:

Install

Release version

gem install serrano

Development version

git clone git@github.com:sckott/serrano.git
cd serrano
rake install

Setup

Crossref's API will likely be used by others in the future, allowing the base URL to be swapped out. You can swap out the base URL by passing named options in a block to Serrano.configuration.

This will also be the way to set up other user options, as needed down the road.

Serrano.configuration do |config|
  config.base_url = "http://api.crossref.org"
end

Examples

Search works by DOI

require 'serrano'
Serrano.works(doi: '10.1371/journal.pone.0033693')

Search works by query string

Serrano.works(query: "ecology")

Search journals by publisher name

Serrano.journals(query: "peerj")

Search funding information by DOI

Serrano.funders(ids: ['10.13039/100000001','10.13039/100000015'])

Get agency for a set of DOIs

Serrano.agency(ids: ['10.1007/12080.1874-1746','10.1007/10452.1573-5125'])

Get random set of DOIs

Serrano.random_dois(sample: 100)

Content negotiation

Serrano.cn(ids: '10.1126/science.169.3946.635', format: "citeproc-json")

Text mining

res = Serrano.text(url: 'http://...');

Meta

  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
  • License: MIT