Clients to the 'Web of Science' and 'InCites' APIs

R clients to the 'Web of Science' and 'InCites' < https://clarivate.com/products/data-integration/> APIs, which allow you to programmatically download publication and citation data indexed in the 'Web of Science' and 'InCites' databases.


Linux Build Status CRAN version

Installation

You can get the stable version from CRAN:

install.packages("wosr")

Or the development version from GitHub:

if (!"devtools" %in% rownames(installed.packages())) 
  install.packages("devtools")
 
devtools::install_github("vt-arc/wosr")

Web of Science

library(wosr)
Sys.setenv(WOS_USERNAME = "your_username", WOS_PASSWORD = "your_password")
 
# Get session ID
sid <- auth()
# Query WoS to see how many results match your query
query <- 'TS = ("animal welfare") AND PY = (2002-2003)'
query_wos(query, sid = sid)
#> Matching records: 548
# Download data
pull_wos(query, sid = sid)
#> List of 9
#>  $ publication   :'data.frame':  548 obs. of  7 variables:
#>   ..$ ut       : chr [1:548] "WOS:000186387100005" ...
#>   ..$ title    : chr [1:548] "Farm animal welfare: The interaction of et"..
#>   ..$ journal  : chr [1:548] "Animal Welfare" ...
#>   ..$ date     : Date[1:548], format: "2003-11-01" ...
#>   ..$ doi      : chr [1:548] NA ...
#>   ..$ tot_cites: int [1:548] 37 15 ...
#>   ..$ abstract : chr [1:548] "Farm animal welfare has now been studied, "..
#>  $ author        :'data.frame':  1438 obs. of  7 variables:
#>   ..$ ut          : chr [1:1438] "WOS:000186387100005" ...
#>   ..$ author_no   : int [1:1438] 1 2 ...
#>   ..$ display_name: chr [1:1438] "Sandoe, P" ...
#>   ..$ first_name  : chr [1:1438] "P" ...
#>   ..$ last_name   : chr [1:1438] "Sandoe" ...
#>   ..$ email       : chr [1:1438] "[email protected]" ...
#>   ..$ daisng_id   : int [1:1438] 193024 3304655 ...
#>  $ address       :'data.frame':  838 obs. of  7 variables:
#>   ..$ ut      : chr [1:838] "WOS:000186387100005" ...
#>   ..$ addr_no : int [1:838] 1 2 ...
#>   ..$ org_pref: chr [1:838] "University of Copenhagen" ...
#>   ..$ org     : chr [1:838] "Royal Vet & Agr Univ" ...
#>   ..$ city    : chr [1:838] "Frederiksberg" ...
#>   ..$ state   : chr [1:838] NA ...
#>   ..$ country : chr [1:838] "Denmark" ...
#>  $ author_address:'data.frame':  18 obs. of  3 variables:
#>   ..$ ut       : chr [1:18] "WOS:000208276800197" ...
#>   ..$ author_no: int [1:18] 1 2 ...
#>   ..$ addr_no  : int [1:18] 1 1 ...
#>  $ jsc           :'data.frame':  901 obs. of  2 variables:
#>   ..$ ut : chr [1:901] "WOS:000186387100005" ...
#>   ..$ jsc: chr [1:901] "Veterinary Sciences" ...
#>  $ keyword       :'data.frame':  2096 obs. of  2 variables:
#>   ..$ ut     : chr [1:2096] "WOS:000186387100005" ...
#>   ..$ keyword: chr [1:2096] "animal welfare" ...
#>  $ keywords_plus :'data.frame':  2020 obs. of  2 variables:
#>   ..$ ut           : chr [1:2020] "WOS:000179260700001" ...
#>   ..$ keywords_plus: chr [1:2020] "system" ...
#>  $ grant         :'data.frame':  1 obs. of  3 variables:
#>   ..$ ut          : chr "WOS:000208574800048"
#>   ..$ grant_agency: chr "Selcuk University Research Foundation"
#>   ..$ grant_id    : chr "2000/062"
#>  $ doc_type      :'data.frame':  642 obs. of  2 variables:
#>   ..$ ut      : chr [1:642] "WOS:000186387100005" ...
#>   ..$ doc_type: chr [1:642] "Article" ...

InCites

# Save your InCites developer key in an environment variable
Sys.setenv(INCITES_KEY = "your_key")
# Vector of UTs (publication identifiers) to get InCites data for
uts <- c("000272272000015", "000272366800025", "000272877700013")
 
# Download InCites data for those UTs
pull_incites(uts)
#>                      ut article_type tot_cites journal_expected_citations
#> 1.1 WOS:000272877700013           AA         1                        3.4
#> 1.2 WOS:000272366800025           AA         4                        4.3
#> 1.3 WOS:000272272000015           AA         3                        9.1
#>     journal_act_exp_citations impact_factor avg_expected_rate percentile
#> 1.1                      0.29          0.49                20         87
#> 1.2                      0.93          0.85                20         63
#> 1.3                      0.33          1.90                20         69
#>      nci esi_most_cited_article hot_paper is_international_collab
#> 1.1 0.05                  FALSE     FALSE                   FALSE
#> 1.2 0.20                  FALSE     FALSE                   FALSE
#> 1.3 0.15                  FALSE     FALSE                   FALSE
#>     is_institution_collab is_industry_collab oa_flag
#> 1.1                 FALSE              FALSE   FALSE
#> 1.2                 FALSE              FALSE   FALSE
#> 1.3                 FALSE              FALSE   FALSE

Web of Science and InCites

# Download WoS data
wos <- pull_wos('TS = ("dog welfare")', sid = sid)
 
# Download InCites data
head(pull_incites(wos$publication$ut))
#>                      ut article_type tot_cites journal_expected_citations
#> 1.1 WOS:A1996VH04300002           AA        19                     30.308
#> 1.2 WOS:000439855300030            L         0                      0.068
#> 1.3 WOS:000438259600009           AA         1                      1.186
#> 1.4 WOS:000438259600004           AA         1                      1.186
#> 1.5 WOS:000436270600004           AA         1                      0.321
#> 1.6 WOS:000435128900013            R         3                      2.000
#>     journal_act_exp_citations impact_factor avg_expected_rate percentile
#> 1.1                      0.63           1.5             19.20       22.8
#> 1.2                      0.00           2.0              0.11      100.0
#> 1.3                      0.84           1.6              0.21       12.5
#> 1.4                      0.84           1.6              0.21       12.5
#> 1.5                      3.12           1.7              0.15       11.5
#> 1.6                      1.50           1.6              0.40        1.5
#>      nci esi_most_cited_article hot_paper is_international_collab
#> 1.1 0.99                  FALSE     FALSE                   FALSE
#> 1.2 0.00                  FALSE     FALSE                   FALSE
#> 1.3 4.74                  FALSE     FALSE                   FALSE
#> 1.4 4.74                  FALSE     FALSE                   FALSE
#> 1.5 6.46                  FALSE     FALSE                   FALSE
#> 1.6 7.46                  FALSE     FALSE                    TRUE
#>     is_institution_collab is_industry_collab oa_flag
#> 1.1                 FALSE              FALSE   FALSE
#> 1.2                 FALSE              FALSE   FALSE
#> 1.3                 FALSE              FALSE   FALSE
#> 1.4                 FALSE              FALSE   FALSE
#> 1.5                 FALSE              FALSE    TRUE
#> 1.6                  TRUE              FALSE   FALSE

Learning more

  • To learn more, head over to wosr's webpage.

News

wosr 0.3.0

New functions

  • pull_cited_refs() added to pull a publication's cited references (#5)
  • pull_related_recs() added to pull a publication's set of related references
  • create_ut_quereis() added to create a list of UT-based queries

Misc

  • An error is no longer thrown when user attempts IP-based authentication (#6)
  • write_wos_data() now creates the directory to write files to if it doesn't already exist

wosr 0.2.0

New functions

  • query_wos_apply() and pull_wos_apply() added to issue multiple queries to the WoS API and pull the data for those queries, respectively

Misc

  • pull_wos() now returns empty data frames instead of NA if the user's query returns no results
  • pull_wos() explicitly casts all string fields to be character vectors, and pull_incites() now correctly casts the esi_most_cited_article field to be a logical vector (instead of a numeric)

wosr 0.1.2

New functions

  • write_wos_data() and read_wos_data() added to write the data returned by pull_wos() as a series of CSVs and to read those CSVs back into R

Bug fixes

  • pull_wos() now sleeps one second whenever it encounters a throttling limit

wosr 0.1.1

Misc

  • The InCites API was updated by Clarivate, including moving to a new endpoint URL and changing the order of fields returned by the "DocumentLevelMetricsByUT" method. Small changes to the internals of pull_incites() were made to reflect this.

wosr 0.1.0

New functions

  • auth() added to get a session ID from WoS API server
  • query_wos() and pull_wos() added to query and download data from the WoS API, respectively
  • pull_incites() added to pull data from the InCites API

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("wosr")

0.3.0 by Christopher Baker, 7 months ago


https://vt-arc.github.io/wosr/index.html


Report a bug at https://github.com/vt-arc/wosr/issues


Browse source code at https://github.com/cran/wosr


Authors: Christopher Baker [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports httr, xml2, jsonlite, pbapply, utils, tools

Suggests testthat, knitr, rmarkdown, dplyr


See at CRAN