Skip to contents

 

https://github.com/ropensci/openalexR

Latest version: 1.0.2.9, 2023-05-24

 

by Massimo Aria

Full Professor in Social Statistics

PhD in Computational Statistics

Laboratory and Research Group STAD Statistics, Technology, Data Analysis

Department of Economics and Statistics

University of Naples Federico II

email

https://massimoaria.com

 

An R-package to gather bibliographic data from OpenAlex

openalexR helps you interface with the OpenAlex API to retrieve bibliographic infomation about publications, authors, venues, institutions and concepts with 4 main functions:

  • oa_query(): generates a valid query, written following the OpenAlex API syntax, from a set of arguments provided by the user.

  • oa_request(): downloads a collection of entities matching the query created by oa_query() or manually written by the user, and returns a JSON object in a list format.

  • oa2df(): converts the JSON object in classical bibliographic tibble/data frame.

  • oa_fetch(): composes three functions above so the user can execute everything in one step, i.e., oa_query |> oa_request |> oa2df

  • oa_random(): to get random entity, e.g., oa_random("works") gives a different work each time you run it

Works (think papers, publications)

This paper:

Aria, M., & Cuccurullo, C. (2017). bibliometrix: 
An R-tool for comprehensive science mapping analysis. 
Journal of informetrics, 11(4), 959-975.

is associated to the OpenAlex-id W2755950973. If you know your paper’s OpenAlex ID, all you need to do is passing identifier = <openalex id> as an argument in oa_fetch():

paper_id <- oa_fetch(
  identifier = "W2755950973",
  entity = "works",
  verbose = TRUE
)
## Requesting url: https://api.openalex.org/works/W2755950973
dplyr::glimpse(paper_id)
## Rows: 1
## Columns: 30
## $ id                <chr> "https://openalex.org/W2755950973"
## $ display_name      <chr> "bibliometrix : An R-tool for comprehensive science …
## $ author            <list> [<data.frame[2 x 10]>]
## $ ab                <chr> "Abstract The use of bibliometrics is gradually exte…
## $ publication_date  <chr> "2017-11-01"
## $ so                <chr> "Journal of Informetrics"
## $ so_id             <chr> "https://openalex.org/S205292342"
## $ host_organization <chr> "Elsevier BV"
## $ issn_l            <chr> "1751-1577"
## $ url               <chr> "https://doi.org/10.1016/j.joi.2017.08.007"
## $ pdf_url           <lgl> NA
## $ license           <lgl> NA
## $ version           <lgl> NA
## $ first_page        <chr> "959"
## $ last_page         <chr> "975"
## $ volume            <chr> "11"
## $ issue             <chr> "4"
## $ is_oa             <lgl> FALSE
## $ cited_by_count    <int> 2693
## $ counts_by_year    <list> [<data.frame[8 x 2]>]
## $ publication_year  <int> 2017
## $ cited_by_api_url  <chr> "https://api.openalex.org/works?filter=cites:W27559…
## $ ids               <list> [<tbl_df[3 x 2]>]
## $ doi               <chr> "https://doi.org/10.1016/j.joi.2017.08.007"
## $ type              <chr> "journal-article"
## $ referenced_works  <list> <"https://openalex.org/W767067438", "https://openale…
## $ related_works     <list> <"https://openalex.org/W1996408511", "https://openal…
## $ is_paratext       <lgl> FALSE
## $ is_retracted      <lgl> FALSE
## $ concepts          <list> [<data.frame[2 x 5]>]

oa_fetch() is a composition of functions: oa_query |> oa_request |> oa2df. As results, oa_query() returns the query string including the OpenAlex endpoint API server address (default). oa_request() downloads the bibliographic records matching the query. Finally, oa2df() converts the final result list to a tibble. The final result is a complicated tibble, but we can use show_works() to display a simplified version:

paper_id %>% 
  show_works() %>%
  knitr::kable()
id display_name first_author last_author so url is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo Journal of Informetrics https://doi.org/10.1016/j.joi.2017.08.007 FALSE Data science

External id formats

OpenAlex endpoint accepts OpenAlex IDs and other external IDs (e.g., DOI, ISSN) in several formats, including Digital Object Identifier (DOI) and Persistent Identifiers (PIDs).

oa_fetch(
  # identifier = "https://doi.org/10.1016/j.joi.2017.08.007", # would also work (PIDs)
  identifier = "doi:10.1016/j.joi.2017.08.007",
  entity = "works"
) %>% 
  show_works() %>%
  knitr::kable()
id display_name first_author last_author so url is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo Journal of Informetrics https://doi.org/10.1016/j.joi.2017.08.007 FALSE Data science

More than one publications/authors

https://api.openalex.org/authors/https://orcid.org/

If you know the OpenAlex IDs of these entities, you can also feed them into the identifier argument.

oa_fetch(
  identifier = c("W2741809807", "W2755950973"),
  # identifier = c("https://doi.org/10.1016/j.joi.2017.08.007", "https://doi.org/10.1016/j.joi.2017.08.007"), # TODO
  entity = "works",
  verbose = TRUE
) %>% 
  show_works() %>%
  knitr::kable()
## Requesting url: https://api.openalex.org/works?filter=openalex_id%3AW2741809807%7CW2755950973
## Getting 1 page of results with a total of 2 records...
id display_name first_author last_author so url is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo Journal of Informetrics https://doi.org/10.1016/j.joi.2017.08.007 FALSE Data science
W2741809807 The state of OA: a large-scale analysis of the prevalence and impact of Open Access articles Heather A. Piwowar Stefanie Haustein PeerJ https://doi.org/10.7717/peerj.4375 TRUE Citation, License, Open science

However, if you only know their external identifies, say, DOIs, you would need to use doi as a filter (either the canonical form with https://doi.org/ or without should work):

oa_fetch(
  # identifier = c("W2741809807", "W2755950973"),
  doi = c("10.1016/j.joi.2017.08.007", "https://doi.org/10.1093/bioinformatics/btab727"),
  entity = "works",
  verbose = TRUE
) %>% 
  show_works() %>%
  knitr::kable()
## Requesting url: https://api.openalex.org/works?filter=doi%3A10.1016%2Fj.joi.2017.08.007%7Chttps%3A%2F%2Fdoi.org%2F10.1093%2Fbioinformatics%2Fbtab727
## Getting 1 page of results with a total of 2 records...
id display_name first_author last_author so url is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo Journal of Informetrics https://doi.org/10.1016/j.joi.2017.08.007 FALSE Data science
W3206431085 PMLB v1.0: an open-source dataset collection for benchmarking machine learning methods Joseph P. Romano Jason H. Moore Bioinformatics https://doi.org/10.1093/bioinformatics/btab727 TRUE Python (programming language), Benchmarking, Benchmark (surveying)

Filters

In most cases, we are interested in downloading a collection of items that meet one or more inclusion/exclusion criteria (filters). Supported filters for each entity are listed here.

Example: We want to download all works published by a set of authors. We can do this by filtering on the authorships.author.id/author.id or authorships.author.orcid/author.orcid attribute (see more on works attributes):

oa_fetch(
  entity = "works",
  author.id = c("A923435168", "A2208157607"),
  verbose = TRUE
) %>% 
  show_works() %>% 
  knitr::kable()
## Requesting url: https://api.openalex.org/works?filter=author.id%3AA923435168%7CA2208157607
## Getting 1 page of results with a total of 156 records...
id display_name first_author last_author so url is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo Journal of Informetrics https://doi.org/10.1016/j.joi.2017.08.007 FALSE Data science
W2408216567 Foundations and trends in performance management. A twenty-five years bibliometric analysis in business and public administration domains Corrado Cuccurullo Fabrizia Sarto Scientometrics https://doi.org/10.1007/s11192-016-1948-8 FALSE Administration (probate law), Bibliometrics, Public management
W1979874437 Analysis of powered two-wheeler crashes in Italy by classification trees and rules discovery Alfonso Montella Filomena Mauriello Accident Analysis & Prevention https://doi.org/10.1016/j.aap.2011.04.025 FALSE Crash, Decision tree, Identification (biology)
W3005144120 Mapping the Evolution of Social Research and Data Science on 30 Years of Social Indicators Research Massimo Aria Maria Sabrina Spano Social Indicators Research https://doi.org/10.1007/s11205-020-02281-3 FALSE Human geography, Public health
W2281330131 Coopetition and sustainable competitive advantage. The case of tourist destinations Valentina Della Corte Massimo Aria Tourism Management https://doi.org/10.1016/j.tourman.2015.12.009 FALSE Competitive advantage, Tourism, Game theory
W1999880985 Simulator evaluation of drivers’ speed, deceleration and lateral position at rural intersections in relation to different perceptual cues Alfonso Montella Mariano Pernetti Accident Analysis & Prevention https://doi.org/10.1016/j.aap.2011.05.030 FALSE Intersection (aeronautics), Driving simulator, Poison control
orcids <- c("0000-0003-3737-6565", "0000-0002-8517-9411")
canonical_orcids <- paste0("https://orcid.org/", orcids)
oa_fetch(
  entity = "works",
  author.orcid = canonical_orcids,
  verbose = TRUE
) %>% 
  show_works() %>% 
  knitr::kable()
## Requesting url: https://api.openalex.org/works?filter=author.orcid%3Ahttps%3A%2F%2Forcid.org%2F0000-0003-3737-6565%7Chttps%3A%2F%2Forcid.org%2F0000-0002-8517-9411
## Getting 1 page of results with a total of 156 records...
id display_name first_author last_author so url is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo Journal of Informetrics https://doi.org/10.1016/j.joi.2017.08.007 FALSE Data science
W2408216567 Foundations and trends in performance management. A twenty-five years bibliometric analysis in business and public administration domains Corrado Cuccurullo Fabrizia Sarto Scientometrics https://doi.org/10.1007/s11192-016-1948-8 FALSE Administration (probate law), Bibliometrics, Public management
W1979874437 Analysis of powered two-wheeler crashes in Italy by classification trees and rules discovery Alfonso Montella Filomena Mauriello Accident Analysis & Prevention https://doi.org/10.1016/j.aap.2011.04.025 FALSE Crash, Decision tree, Identification (biology)
W3005144120 Mapping the Evolution of Social Research and Data Science on 30 Years of Social Indicators Research Massimo Aria Maria Sabrina Spano Social Indicators Research https://doi.org/10.1007/s11205-020-02281-3 FALSE Human geography, Public health
W2281330131 Coopetition and sustainable competitive advantage. The case of tourist destinations Valentina Della Corte Massimo Aria Tourism Management https://doi.org/10.1016/j.tourman.2015.12.009 FALSE Competitive advantage, Tourism, Game theory
W1999880985 Simulator evaluation of drivers’ speed, deceleration and lateral position at rural intersections in relation to different perceptual cues Alfonso Montella Mariano Pernetti Accident Analysis & Prevention https://doi.org/10.1016/j.aap.2011.05.030 FALSE Intersection (aeronautics), Driving simulator, Poison control

Example: We want to download all works that have been cited more than 50 times, published between 2020 and 2021, and include the strings “bibliometric analysis” or “science mapping” in the title. Maybe we also want the results to be sorted by total citations in a descending order.

Setting the argument count_only = TRUE, the function oa_request() returns the number of items matching the query without downloading the collection.

oa_fetch(
  entity = "works",
  title.search = c("bibliometric analysis", "science mapping"),
  cited_by_count = ">50", 
  from_publication_date = "2020-01-01",
  to_publication_date = "2021-12-31",
  options = list(sort = "cited_by_count:desc"),
  count_only = TRUE,
  verbose = TRUE
)
## Requesting url: https://api.openalex.org/works?filter=title.search%3Abibliometric%20analysis%7Cscience%20mapping%2Ccited_by_count%3A%3E50%2Cfrom_publication_date%3A2020-01-01%2Cto_publication_date%3A2021-12-31&sort=cited_by_count%3Adesc
##      count db_response_time_ms page per_page
## [1,]    96                  21    1        1

We can now download the records and transform it into a tibble/data frame by setting count_only = FALSE (also the default value):

oa_fetch(
  entity = "works",
  title.search = c("bibliometric analysis", "science mapping"),
  cited_by_count = ">50", 
  from_publication_date = "2020-01-01",
  to_publication_date = "2021-12-31",
  options = list(sort = "cited_by_count:desc"),
  count_only = FALSE
) %>%
  show_works() %>%
  knitr::kable()
id display_name first_author last_author so url is_oa top_concepts
W3160856016 How to conduct a bibliometric analysis: An overview and guidelines Naveen Donthu Weng Marc Lim Journal of Business Research https://doi.org/10.1016/j.jbusres.2021.04.070 TRUE Bibliometrics, Field (mathematics), Resource (disambiguation)
W3038273726 Investigating the emerging COVID-19 research trends in the field of business and management: A bibliometric analysis approach Surabhi Verma Anders Gustafsson Journal of Business Research https://doi.org/10.1016/j.jbusres.2020.06.057 FALSE Bibliometrics, Field (mathematics), MEDLINE
W2990450011 Forty-five years of Journal of Business Research: A bibliometric analysis Naveen Donthu Debidutta Pattnaik Journal of Business Research https://doi.org/10.1016/j.jbusres.2019.10.039 FALSE Publishing, Bibliometrics, Empirical research
W3001491100 Software tools for conducting bibliometric analysis in science: An up-to-date review Jose A. Moral-Munoz Manuel Cobo Profesional De La Informacion https://doi.org/10.3145/epi.2020.ene.03 TRUE Bibliometrics, Software
W3044902155 Financial literacy: A systematic review and bibliometric analysis Kirti Savyasacchi Goyal Satish Kumar International Journal of Consumer Studies https://doi.org/10.1111/ijcs.12605 FALSE Financial literacy, Citation, Content analysis
W3042215340 A bibliometric analysis using VOSviewer of publications on COVID-19 Yuetian Yu Erzhen Chen Annals of Translational Medicine https://doi.org/10.21037/atm-20-4235 TRUE Citation, Bibliometrics, China

Read on to see how we can shorten these two function calls.

Authors

Similarly to work, we can use identifier to pass in authors’ OpenAlex ID.

Example: We want more information on authors with IDs A923435168 and A2208157607.

oa_fetch(
  identifier = c("A923435168", "A2208157607"),
  verbose = TRUE
) %>%
  show_authors() %>%
  knitr::kable()
## Requesting url: https://api.openalex.org/authors?filter=openalex_id%3AA923435168%7CA2208157607
## Getting 1 page of results with a total of 2 records...
id display_name orcid works_count cited_by_count affiliation_display_name top_concepts
A923435168 Massimo Aria 0000-0002-8517-9411 157 4595 University of Naples Federico II Statistics, Internal medicine, Pathology
A2208157607 Jason Priem 0000-0001-6187-6610 3 1 HortResearch World Wide Web, Data science, Internet privacy

Example: We want download all authors’ records of scholars who work at the University of Naples Federico II (OpenAlex ID: I71267560) and who have published more than 499 works.

Let’s first check how many records match the query, then set count_only = FALSE to download the entire collection. We can do this by first defining a list of arguments, then adding count_only (default FALSE) to this list:

my_arguments <- list(
  entity = "authors",
  last_known_institution.id = "I71267560",
  works_count = ">499"
  )

do.call(oa_fetch, c(my_arguments, list(count_only = TRUE)))
##      count db_response_time_ms page per_page
## [1,]    34                  48    1        1
do.call(oa_fetch, my_arguments) %>% 
  show_authors() %>%
  knitr::kable()
id display_name orcid works_count cited_by_count affiliation_display_name top_concepts
A2061787601 Luca Lista 0000-0001-6471-5492 2009 51621 University of Naples Federico II Particle physics, Nuclear physics, Quantum mechanics
A3088244307 A. K. Sanchez NA 1993 49537 University of Naples Federico II Quantum mechanics, Nuclear physics, Particle physics
A4355442610 Mario Mancini NA 1317 13032 University of Naples Federico II Internal medicine, Biochemistry, Endocrinology
A2558588088 Paolo Russo 0000-0001-9409-0008 1209 14132 University of Naples Federico II Internal medicine, Genetics, Quantum mechanics
A4359269603 Leonardo Merola NA 1186 44178 University of Naples Federico II Quantum mechanics, Particle physics, Nuclear physics
A4355147868 M. Napolitano NA 1094 16828 University of Naples Federico II Quantum mechanics, Nuclear physics, Particle physics

You can also use other filters such as display_name, has_orcid, and orcid:

oa_fetch(
  entity = "authors",
  display_name = "Massimo Aria",
  has_orcid = "true"
) %>%
  show_authors() %>%
  knitr::kable()
id display_name orcid works_count cited_by_count affiliation_display_name top_concepts
A923435168 Massimo Aria 0000-0002-8517-9411 157 4595 University of Naples Federico II Statistics, Internal medicine, Pathology
oa_fetch(
  entity = "authors",
  orcid = "0000-0002-8517-9411"
) %>%
  show_authors() %>%
  knitr::kable()
id display_name orcid works_count cited_by_count affiliation_display_name top_concepts
A923435168 Massimo Aria 0000-0002-8517-9411 157 4595 University of Naples Federico II Statistics, Internal medicine, Pathology

Institutions

Example: We want download all records regarding Italian institutions (country_code:it) that are classified as educational (type:education). Again, we check how many records match the query then download the collection:

italian_insts <- list(
  entity = "institutions",
  country_code = "it",
  type = "education",
  verbose = TRUE
)

do.call(oa_fetch, c(italian_insts, list(count_only = TRUE)))
## Requesting url: https://api.openalex.org/institutions?filter=country_code%3Ait%2Ctype%3Aeducation
##      count db_response_time_ms page per_page
## [1,]   232                  12    1        1
dplyr::glimpse(do.call(oa_fetch, italian_insts))
## Requesting url: https://api.openalex.org/institutions?filter=country_code%3Ait%2Ctype%3Aeducation
## Getting 2 pages of results with a total of 232 records...
## Rows: 232
## Columns: 21
## $ id                        <chr> "https://openalex.org/I861853513", "https://…
## $ display_name              <chr> "Sapienza University of Rome", "University o…
## $ display_name_alternatives <list> "Università degli Studi di Roma \"La Sapien…
## $ display_name_acronyms     <list> NA, "UNIMI", "UNIBO", "UNIPD", NA, NA, "Uni…
## $ international             <list> [<data.frame[1 x 87]>], [<data.frame[1 x 64…
## $ ror                       <chr> "https://ror.org/02be6w209", "https://ror.or…
## $ ids                       <list> [<tbl_df[6 x 2]>], [<tbl_df[6 x 2]>], [<tbl…
## $ country_code              <chr> "IT", "IT", "IT", "IT", "IT", "IT", "IT", "I…
## $ geo                       <list> [<data.frame[1 x 7]>], [<data.frame[1 x 7]>…
## $ type                      <chr> "education", "education", "education", "educ…
## $ homepage_url              <chr> "http://www.uniroma1.it/", "http://www.unimi…
## $ image_url                 <chr> "https://commons.wikimedia.org/w/index.php?t…
## $ image_thumbnail_url       <chr> "https://commons.wikimedia.org/w/index.php?t…
## $ associated_institutions   <list> [<data.frame[4 x 6]>], [<data.frame[2 x 6]>…
## $ works_count               <int> 160072, 144005, 137095, 135058, 95601, 90620…
## $ cited_by_count            <int> 3330004, 3619636, 3068455, 3298763, 2103586,…
## $ counts_by_year            <list> [<data.frame[12 x 3]>], [<data.frame[12 x 3…
## $ works_api_url             <chr> "https://api.openalex.org/works?filter=insti…
## $ x_concepts                <list> [<data.frame[13 x 5]>], [<data.frame[14 x 5…
## $ updated_date              <chr> "2023-05-24T08:09:21.877708", "2023-05-24T03…
## $ created_date              <chr> "2016-06-24", "2016-06-24", "2016-06-24", "2…

Venues (think journals)

Example: We want download all records regarding journals that have published more than 100,000 works:

big_journals <- list(
  entity = "venues",
  works_count = ">100000",
  verbose = TRUE
)

do.call(oa_fetch, c(big_journals, list(count_only = TRUE)))
## Requesting url: https://api.openalex.org/venues?filter=works_count%3A%3E100000
##      count db_response_time_ms page per_page
## [1,]   100                  22    1        1
dplyr::glimpse(do.call(oa_fetch, big_journals))
## Requesting url: https://api.openalex.org/venues?filter=works_count%3A%3E100000
## Getting 1 page of results with a total of 100 records...
## Rows: 100
## Columns: 15
## $ id                     <chr> "https://openalex.org/S4306525036", "https://op…
## $ display_name           <chr> "PubMed", "PubMed Central", "Europe PMC (PubMed…
## $ host_organization_name <chr> "National Institutes of Health", "National Inst…
## $ issn                   <list> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ issn_l                 <list> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ is_oa                  <lgl> FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRU…
## $ is_in_doaj             <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ ids                    <list> [<tbl_df[2 x 2]>], [<tbl_df[3 x 2]>], [<tbl_df…
## $ homepage_url           <chr> "https://pubmed.ncbi.nlm.nih.gov", "http://www.…
## $ works_count            <int> 33077501, 6761672, 5095835, 2972085, 2969152, 2…
## $ cited_by_count         <int> 904092437, 225773064, 218336492, 33581755, 3848…
## $ counts_by_year         <list> [<data.frame[12 x 3]>], [<data.frame[17 x 3]>]…
## $ x_concepts             <list> NA, NA, NA, [<data.frame[3 x 5]>], [<data.fram…
## $ works_api_url          <chr> "https://api.openalex.org/works?filter=primary_…
## $ type                   <chr> "repository", "repository", "repository", "repo…

Concepts (think theme, keywords)

Example: We want to download the records of all the concepts that concern at least one million works:

popular_concepts <- list(
  entity = "concepts",
  works_count = ">1000000",
  verbose = TRUE
)

do.call(oa_fetch, c(popular_concepts, list(count_only = TRUE)))
## Requesting url: https://api.openalex.org/concepts?filter=works_count%3A%3E1000000
##      count db_response_time_ms page per_page
## [1,]   246                   6    1        1
dplyr::glimpse(do.call(oa_fetch, popular_concepts))
## Requesting url: https://api.openalex.org/concepts?filter=works_count%3A%3E1000000
## Getting 2 pages of results with a total of 246 records...
## Rows: 246
## Columns: 16
## $ id                         <chr> "https://openalex.org/C41008148", "https://…
## $ display_name               <chr> "Computer science", "Medicine", "Biology", …
## $ display_name_international <list> [<data.frame[1 x 187]>], [<data.frame[1 x …
## $ description                <chr> "study of computation", "field of study for…
## $ description_international  <list> [<data.frame[1 x 43]>], [<data.frame[1 x 4…
## $ wikidata                   <chr> "https://www.wikidata.org/wiki/Q21198", "ht…
## $ level                      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0…
## $ ids                        <list> [<tbl_df[5 x 2]>], [<tbl_df[5 x 2]>], [<tb…
## $ image_url                  <chr> "https://upload.wikimedia.org/wikipedia/com…
## $ image_thumbnail_url        <chr> "https://upload.wikimedia.org/wikipedia/com…
## $ ancestors                  <list> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, [<…
## $ related_concepts           <list> [<data.frame[93 x 5]>], [<data.frame[51 x …
## $ works_count                <int> 80828466, 59078153, 42770725, 39360670, 346…
## $ cited_by_count             <int> 430675791, 603778001, 661020845, 413858643,…
## $ counts_by_year             <list> [<data.frame[12 x 3]>], [<data.frame[12 x …
## $ works_api_url              <chr> "https://api.openalex.org/works?filter=conc…

Other examples

Get all works citing a particular work

We can download all publications citing another publication by using the filter attribute cites.

For example, if we want to download all publications citing the article Aria and Cuccurullo (2017), we have just to set the argument filter as cites = "W2755950973" where “W2755950973” is the OA id for the article by Aria and Cuccurullo.

aria_count <- oa_fetch(
  entity = "works",
  cites = "W2755950973",
  count_only = TRUE,
  verbose = TRUE
) 
## Requesting url: https://api.openalex.org/works?filter=cites%3AW2755950973
aria_count
##      count db_response_time_ms page per_page
## [1,]  2741                  33    1        1

This query will return a collection of NA publications. Among these articles, let’s download the ones published in the following year:

oa_fetch(
  entity = "works",
  cites = "W2755950973",
  publication_year = 2018,
  count_only = FALSE,
  verbose = TRUE
) %>% 
  dplyr::glimpse()
## Requesting url: https://api.openalex.org/works?filter=cites%3AW2755950973%2Cpublication_year%3A2018
## Getting 1 page of results with a total of 17 records...
## Rows: 17
## Columns: 30
## $ id                <chr> "https://openalex.org/W2902888572", "https://openale…
## $ display_name      <chr> "A global bibliometric analysis of Plesiomonas-relat…
## $ author            <list> [<data.frame[2 x 10]>], [<data.frame[7 x 10]>], [<d…
## $ ab                <chr> "Plesiomonas shigelloides is an emerging pathogen wi…
## $ publication_date  <chr> "2018-11-29", "2018-06-25", "2018-04-01", "2018-09-2…
## $ so                <chr> "PLOS ONE", "PLOS ONE", "Journal of Experimental Zoo…
## $ so_id             <chr> "https://openalex.org/S202381698", "https://openalex…
## $ host_organization <chr> "Public Library of Science", "Public Library of Scie…
## $ issn_l            <chr> "1932-6203", "1932-6203", "2471-5638", "0022-0302", …
## $ url               <chr> "https://doi.org/10.1371/journal.pone.0207655", "htt…
## $ pdf_url           <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ license           <chr> "cc-by", "cc-by", "publisher-specific, author manusc…
## $ version           <chr> "publishedVersion", "publishedVersion", "acceptedVer…
## $ first_page        <chr> "e0207655", "e0199706", "162", "10589", "38", "3", N…
## $ last_page         <chr> "e0207655", "e0199706", "176", "10604", "38", "15", …
## $ volume            <chr> "13", "13", "329", "101", "4", NA, NA, "4", "9", NA,…
## $ issue             <chr> "11", "6", "4-5", "12", "3", NA, NA, "11", NA, NA, "…
## $ is_oa             <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TR…
## $ cited_by_count    <int> 74, 58, 56, 51, 36, 34, 20, 17, 15, 14, 11, 10, 7, 4…
## $ counts_by_year    <list> [<data.frame[5 x 2]>], [<data.frame[6 x 2]>], [<dat…
## $ publication_year  <int> 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018…
## $ cited_by_api_url  <chr> "https://api.openalex.org/works?filter=cites:W290288…
## $ ids               <list> [<tbl_df[5 x 2]>], [<tbl_df[5 x 2]>], [<tbl_df[4 x …
## $ doi               <chr> "https://doi.org/10.1371/journal.pone.0207655", "htt…
## $ type              <chr> "journal-article", "journal-article", "journal-artic…
## $ referenced_works  <list> <"https://openalex.org/W177697404", "https://openal…
## $ related_works     <list> <"https://openalex.org/W261917380", "https://openal…
## $ is_paratext       <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FAL…
## $ is_retracted      <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FAL…
## $ concepts          <list> [<data.frame[5 x 5]>], [<data.frame[18 x 5]>], [<da…

Convert an OpenAlex data frame to a bibliometrix object

The bibliometrix R-package (https://www.bibliometrix.org) provides a set of tools for quantitative research in bibliometrics and scientometrics. Today it represents one of the most used science mapping software in the world. In a recent survey on bibliometric analysis tools, Moral-Muñoz et al. (2020) wrote: “At this moment, maybe Bibliometrix and its Shiny platform contain the more extensive set of techniques implemented, and together with the easiness of its interface, could be a great software for practitioners”.

The function oa2bibliometrix converts a bibliographic data frame of works into a bibliometrix object. This object can be used as input collection of a science mapping workflow.

bib_ls <- list(
  identifier = NULL,
  entity = "works",
  cites = "W2755950973",
  from_publication_date = "2022-01-01",
  to_publication_date = "2022-03-31"
)

do.call(oa_fetch, c(bib_ls, list(count_only = TRUE)))
##      count db_response_time_ms page per_page
## [1,]   292                  17    1        1
do.call(oa_fetch, bib_ls) %>% 
  oa2bibliometrix() %>% 
  dplyr::glimpse()
## Rows: 292
## Columns: 43
## $ AU                <chr> "YIXIA CHEN;MINGWEI LIN;DAN ZHUANG", "YONG QIN;ZESHU…
## $ RP                <chr> "COLLEGE OF COMPUTER AND CYBER SECURITY, FUJIAN NORM…
## $ C1                <chr> "COLLEGE OF COMPUTER AND CYBER SECURITY, FUJIAN NORM…
## $ AU_UN             <chr> "", "", "", "", "", "", "", "", "", "", "", "", "", …
## $ AU_CO             <chr> "CHINA;CHINA;CHINA", "CHINA;CHINA;CHINA;CROATIA", "M…
## $ ID                <chr> "WASTEWATER;ENVIRONMENTAL SCIENCE;CONTAMINATION;WEB …
## $ id_url            <chr> "https://openalex.org/W4210864411", "https://openale…
## $ author            <list> [<data.frame[3 x 10]>], [<data.frame[4 x 10]>], [<d…
## $ publication_date  <chr> "2022-02-01", "2022-01-01", "2022-03-08", "2022-03-0…
## $ so_id             <chr> "https://openalex.org/S203465130", "https://openalex…
## $ host_organization <chr> "Elsevier BV", "Elsevier BV", "Wiley-Blackwell", "El…
## $ issn_l            <chr> "0045-6535", "1364-0321", "0742-6046", "0160-791X", …
## $ url               <chr> "https://doi.org/10.1016/j.chemosphere.2022.133932",…
## $ pdf_url           <chr> NA, NA, NA, NA, NA, NA, NA, "https://link.springer.c…
## $ license           <chr> NA, NA, NA, NA, NA, NA, NA, NA, "cc-by", "cc-by-nc-n…
## $ version           <chr> NA, NA, NA, NA, NA, "publishedVersion", "publishedVe…
## $ first_page        <chr> "133932", "111780", "1129", "101954", "132941", "448…
## $ last_page         <chr> "133932", "111780", "1155", "101954", "132941", "455…
## $ volume            <chr> "297", "153", "39", "69", "291", "199", "42", "55", …
## $ issue             <chr> NA, NA, "6", NA, NA, NA, NA, "6", "5", NA, NA, "24",…
## $ is_oa             <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE,…
## $ counts_by_year    <list> [<data.frame[2 x 2]>], [<data.frame[2 x 2]>], [<dat…
## $ cited_by_api_url  <chr> "https://api.openalex.org/works?filter=cites:W421086…
## $ ids               <list> [<tbl_df[3 x 2]>], [<tbl_df[3 x 2]>], [<tbl_df[2 x …
## $ doi               <chr> "https://doi.org/10.1016/j.chemosphere.2022.133932",…
## $ referenced_works  <list> <"https://openalex.org/W1854025783", "https://opena…
## $ related_works     <list> <"https://openalex.org/W1547839164", "https://opena…
## $ is_paratext       <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FAL…
## $ is_retracted      <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FAL…
## $ concepts          <list> [<data.frame[16 x 5]>], [<data.frame[19 x 5]>], [<d…
## $ id_oa             <chr> "W4210864411", "W3208801174", "W4220991995", "W42207…
## $ CR                <chr> "https://openalex.org/W1854025783;https://openalex.o…
## $ TI                <chr> "WASTEWATER TREATMENT AND EMERGING CONTAMINANTS: BIB…
## $ AB                <chr> "IN RECENT YEARS, EMERGING CONTAMINANTS HAVE BEEN FO…
## $ SO                <chr> "CHEMOSPHERE", "RENEWABLE & SUSTAINABLE ENERGY REVIE…
## $ DT                <chr> "JOURNAL-ARTICLE", "JOURNAL-ARTICLE", "JOURNAL-ARTIC…
## $ DB                <chr> "openalex", "openalex", "openalex", "openalex", "ope…
## $ JI                <chr> "S203465130", "S68497187", "S102896891", "S149100181…
## $ J9                <chr> "S203465130", "S68497187", "S102896891", "S149100181…
## $ PY                <int> 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022, 2022…
## $ TC                <int> 51, 29, 24, 23, 20, 20, 20, 19, 19, 18, 17, 16, 16, …
## $ SR_FULL           <chr> "YIXIA CHEN, 2022, CHEMOSPHERE", "YONG QIN, 2022, RE…
## $ SR                <chr> "YIXIA CHEN, 2022, CHEMOSPHERE", "YONG QIN, 2022, RE…

About OpenAlex

oar-img

Schema credits: @dhimmel

OpenAlex is a fully open catalog of the global research system. It’s named after the ancient Library of Alexandria. The OpenAlex dataset describes scholarly entities and how those entities are connected to each other. There are five types of entities:

  • Works are papers, books, datasets, etc; they cite other works

  • Authors are people who create works

  • Venues are journals and repositories that host works

  • Institutions are universities and other orgs that are affiliated with works (via authors)

  • Concepts tag Works with a topic

Acknowledgements

Package hex was made with Midjourney and thus inherits a CC BY-NC 4.0 license.