rorcid is an R programmatic interface to the Orcid public API. rorcid is not a product developed or distributed by ORCID®.

Orcid API docs:

The package now works with the v3.0 ORCID API. It’s too complicated to allow users to work with different versions of the API, so it’s hard-coded to v3.0.

Authentication

There are two ways to authenticate with rorcid:

  • Use a token as a result of a OAuth authentication process. The token is a alphanumeric UUID, e.g. dc0a6b6b-b4d4-4276-bc89-78c1e9ede56e. You can get this token by running orcid_auth(), then storing that key (the uuid alone, not the “Bearer” part) either as en environment variable called ORCID_TOKEN in your .Renviron file in your home directory, or as an R option in your .Rprofile file (called orcid_token). See ?Startup for more information. Either an environment variable or R option work. If we don’t find either we do the next option.
  • Interactively login with OAuth. We use a client id and client secret key to ping ORCID.org; at which point you log in with your username/password; then we get back a token (same as the above option). We don’t know your username or password, only the token that we get back. We cache that token locally in a hidden file in whatever working directory you’re in. If you delete that file, or run the code from a new working directory, then we re-authorize.

We recommend the former option. That is, get a token and store it as an environment variable.

If both options above fail, we proceed without using authentication. ORCID does not require authentication at this point, but may in the future - this prepares you for when that happens :)

See https://members.orcid.org/api/oauth/orcid-scopes for more about ORCID OAuth Scopes.

Computing environments without browsers

One pitfall is when you are using rorcid on a server, and you’re ssh’ed in, so that there’s no way to open a browser to do the OAuth browser flow. Similarly for any other situation in which a browser can not be opened. In this case, run orcid_auth() on another machine in which you do have the ability to open a browser, then collect the info that’s ouptput from orcid_auth() and store it as an environment variable (see above).

Package API

  • orcid_search
  • orcid_external_identifiers
  • orcid_auth
  • orcid
  • orcid_qualifications
  • identifiers
  • orcid_activities
  • orcid_employments
  • orcid_bio
  • works
  • orcid_fundings
  • orcid_doi
  • orcid_citations
  • orcid_research_resources
  • orcid_researcher_urls
  • orcid_id
  • orcid_email
  • orcid_keywords
  • orcid_invited_positions
  • orcid_distinctions
  • orcid_peer_reviews
  • orcid_ping
  • orcid_services
  • orcid_memberships
  • browse
  • orcid_person
  • as.orcid
  • check_dois
  • orcid_address
  • orcid_educations
  • orcid_other_names
  • orcid_works

Installation

Stable version

Development version

install.packages("devtools")
devtools::install_github("ropensci/rorcid")
library('rorcid')

as.orcid

There’s a function as.orcid() in this package to help coerce an Orcid ID to an object that holds details for that Orcid ID, prints a nice summary, and you can browse easily to that profile. E.g.

Or you can pass in many IDs

The browse() function lets you browser to a profile easily with a single function call

browse(as.orcid("0000-0002-1642-628X"))

profile

Search Orcid

Get a list of names and Orcid IDs matching a name query

You can string together many search terms

And use boolean operators

And you can use start and rows arguments to do pagination

Search by DOIs

There is a helper function check_dois() that uses a regex checker to see if your DOIs are likely good or likely bad:

All good DOIs

Some good, some bad

Basic search

This DOI is not a real one, but a partial DOI, then we can fuzzy search

Meta

ropensci_footer