Skip to contents

 

https://github.com/ropensci/openalexR

Latest version: 3.1.2.9000, 2026-12-02

 

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 information about publications, authors, institutions, sources, funders, publishers, topics and concepts with 5 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: 43
## $ id                            <chr> "https://openalex.org/W2755950973"
## $ title                         <chr> "bibliometrix : An R-tool for comprehens…
## $ display_name                  <chr> "bibliometrix : An R-tool for comprehens…
## $ authorships                   <list> [<tbl_df[2 x 9]>]
## $ doi                           <chr> "https://doi.org/10.1016/j.joi.2017.08.0…
## $ publication_date              <date> 2017-09-12
## $ publication_year              <int> 2017
## $ fwci                          <dbl> 449.3088
## $ cited_by_count                <int> 23682
## $ counts_by_year                <list> [<data.frame[14 x 2]>]
## $ ids                           <list> <"https://openalex.org/W2755950973", "h…
## $ type                          <chr> "article"
## $ is_oa                         <lgl> FALSE
## $ is_oa_anywhere                <lgl> FALSE
## $ oa_status                     <chr> "closed"
## $ oa_url                        <lgl> NA
## $ any_repository_has_fulltext   <lgl> FALSE
## $ source_display_name           <chr> "Journal of Informetrics"
## $ source_id                     <chr> "https://openalex.org/S205292342"
## $ issn_l                        <chr> "1751-1577"
## $ host_organization             <chr> "https://openalex.org/P4310320990"
## $ host_organization_name        <chr> "Elsevier BV"
## $ landing_page_url              <chr> "https://doi.org/10.1016/j.joi.2017.08.0…
## $ pdf_url                       <lgl> NA
## $ license                       <lgl> NA
## $ version                       <chr> "publishedVersion"
## $ referenced_works              <list> <"https://openalex.org/W189804332", "ht…
## $ referenced_works_count        <int> 55
## $ related_works                 <list> <"https://openalex.org/W1981886524", "ht…
## $ concepts                      <list> [<data.frame[10 x 5]>]
## $ topics                        <list> [<tbl_df[12 x 5]>]
## $ keywords                      <list> [<data.frame[8 x 3]>]
## $ is_paratext                   <lgl> FALSE
## $ is_retracted                  <lgl> FALSE
## $ language                      <chr> "en"
## $ sustainable_development_goals <lgl> NA
## $ awards                        <lgl> NA
## $ funders                       <lgl> NA
## $ apc                           <list> [<data.frame[2 x 5]>]
## $ first_page                    <chr> "959"
## $ last_page                     <chr> "975"
## $ volume                        <chr> "11"
## $ issue                         <chr> "4"

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 is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo FALSE Workflow, Bibliometrics, Software

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 is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo FALSE Workflow, Bibliometrics, Software

More than one publication/author

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%3AW2741809807%7CW2755950973>
## ℹ Getting 1 page of results with a total of 2 records...
id display_name first_author last_author is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo FALSE Workflow, Bibliometrics, Software
W2741809807 The state of OA: a large-scale analysis of the prevalence and impact of Open Access articles Heather Piwowar Stefanie Haustein TRUE Citation, License, Bibliometrics

However, if you only know their external identifiers, 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 is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo FALSE Workflow, Bibliometrics, Software
W3108030349 PMLB v1.0: an open-source dataset collection for benchmarking machine learning methods Joseph D. Romano Jason H. Moore TRUE Benchmarking, Python (programming language), 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("A5048491430", "A5023888391"),
  verbose = TRUE
) %>% 
  show_works() %>% 
  knitr::kable()
## Requesting url:
## <https://api.openalex.org/works?filter=author.id%3AA5048491430%7CA5023888391>
## ℹ Getting 1 page of results with a total of 96 records...
## Warning: ! The following work has truncated lists of authors: "W4230863633".
## ℹ Query each work separately by its identifier to get full list of authors.
## ℹ For example: `lapply(c("W4230863633"), \(x) oa_fetch(identifier = x))`
## ℹ Details at <https://developers.openalex.org/api-reference/authors>.
id display_name first_author last_author is_oa top_concepts
W2741809807 The state of OA: a large-scale analysis of the prevalence and impact of Open Access articles Heather Piwowar Stefanie Haustein TRUE Citation, License, Bibliometrics
W4229010617 OpenAlex: A fully-open index of scholarly works, authors, venues, institutions, and concepts Jason R Priem Richard Orr TRUE Metadata, Parsing, Data deduplication
W2046766973 Sharing Detailed Research Data Is Associated with Increased Citation Rate Heather Piwowar Douglas B. Fridsma TRUE Citation, Clinical trial, Impact factor
W2045657963 Data reuse and the open data citation advantage Heather Piwowar Todd Vision TRUE Citation, Reuse
W3130540911 Altmetrics: A manifesto Jason R Priem Cameron Neylon TRUE Altmetrics, Manifesto
W2122130843 Scientometrics 2.0: New metrics of scholarly impact on the social Web Jason R Priem Bradely H. Hemminger TRUE Bookmarking, Altmetrics, Social media
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 2 pages of results with a total of 289 records...
## Warning: ! The following works have truncated lists of authors: "W3202287394",
##   "W4308429122", "W4311249176", "W4365450166", "W4386776358", "W3207775241",
##   and "W4282837431".
## ℹ Query each work separately by its identifier to get full list of authors.
## ℹ For example: `lapply(c("W3202287394", "W4308429122"), \(x)
##   oa_fetch(identifier = x))`
## ℹ Details at <https://developers.openalex.org/api-reference/authors>.
id display_name first_author last_author is_oa top_concepts
W2755950973 bibliometrix : An R-tool for comprehensive science mapping analysis Massimo Aria Corrado Cuccurullo FALSE Workflow, Bibliometrics, Software
W2777772618 Interoception and Mental Health: A Roadmap Sahib S. Khalsa Nancy L. Zucker TRUE Mental health, Perception
W3005144120 Mapping the Evolution of Social Research and Data Science on 30 Years of Social Indicators Research Massimo Aria Maria Spano FALSE Human geography, Data collection, Position (finance)
W2955219525 Scaling tree-based automated machine learning to biomedical big data with a feature set selector Trang T. Le Jason H. Moore TRUE Pipeline (software), Scalability, Feature (linguistics)
W2408216567 Foundations and trends in performance management. A twenty-five years bibliometric analysis in business and public administration domains Corrado Cuccurullo Fabrizia Sarto FALSE Domain (mathematical analysis), Content analysis, Public domain
W3177082483 A comparison among interpretative proposals for Random Forests Massimo Aria Agostino Gnasso TRUE Random forest, Interpretability, Categorical variable

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 = oa_options(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
## [1] 826
## 
## $db_response_time_ms
## [1] 26
## 
## $page
## [1] 1
## 
## $per_page
## [1] 1
## 
## $groups_count
## NULL
## 
## $x_query
## $x_query$oql
## [1] "get works from 2020-01-01 through 2021-12-31 with (bibliometric analysis OR science mapping) in the title where citation count is above 50, most cited first"
## 
## $x_query$x_new_oql
## [1] "get works from 2020-01-01 through 2021-12-31 with (bibliometric analysis OR science mapping) in the title where citation count is above 50, most cited first"
## 
## $x_query$oqo
## $x_query$oqo$get_rows
## [1] "works"
## 
## $x_query$oqo$filter_rows
## $x_query$oqo$filter_rows[[1]]
## $x_query$oqo$filter_rows[[1]]$column_id
## [1] "cited_by_count"
## 
## $x_query$oqo$filter_rows[[1]]$value
## [1] 50
## 
## $x_query$oqo$filter_rows[[1]]$operator
## [1] ">"
## 
## 
## $x_query$oqo$filter_rows[[2]]
## $x_query$oqo$filter_rows[[2]]$column_id
## [1] "from_publication_date"
## 
## $x_query$oqo$filter_rows[[2]]$value
## [1] "2020-01-01"
## 
## 
## $x_query$oqo$filter_rows[[3]]
## $x_query$oqo$filter_rows[[3]]$column_id
## [1] "to_publication_date"
## 
## $x_query$oqo$filter_rows[[3]]$value
## [1] "2021-12-31"
## 
## 
## $x_query$oqo$filter_rows[[4]]
## $x_query$oqo$filter_rows[[4]]$join
## [1] "or"
## 
## $x_query$oqo$filter_rows[[4]]$filters
## $x_query$oqo$filter_rows[[4]]$filters[[1]]
## $x_query$oqo$filter_rows[[4]]$filters[[1]]$column_id
## [1] "display_name.search"
## 
## $x_query$oqo$filter_rows[[4]]$filters[[1]]$value
## [1] "bibliometric analysis"
## 
## $x_query$oqo$filter_rows[[4]]$filters[[1]]$operator
## [1] "has"
## 
## 
## $x_query$oqo$filter_rows[[4]]$filters[[2]]
## $x_query$oqo$filter_rows[[4]]$filters[[2]]$column_id
## [1] "display_name.search"
## 
## $x_query$oqo$filter_rows[[4]]$filters[[2]]$value
## [1] "science mapping"
## 
## $x_query$oqo$filter_rows[[4]]$filters[[2]]$operator
## [1] "has"
## 
## 
## 
## 
## 
## $x_query$oqo$sort_by
## $x_query$oqo$sort_by[[1]]
## $x_query$oqo$sort_by[[1]]$column_id
## [1] "cited_by_count"
## 
## $x_query$oqo$sort_by[[1]]$direction
## [1] "desc"
## 
## 
## 
## 
## $x_query$url
## [1] "/works?filter=cited_by_count:%3E50,from_publication_date:2020-01-01,to_publication_date:2021-12-31,display_name.search:bibliometric analysis|science mapping&sort=cited_by_count:desc&per_page=1"
## 
## $x_query$order
## [1] "most cited first"
## 
## $x_query$order_default
## [1] FALSE
## 
## 
## $cost_usd
## [1] 1e-04

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 = oa_options(sort = "cited_by_count:desc"),
  count_only = FALSE
) %>%
  show_works() %>%
  knitr::kable()
id display_name first_author last_author is_oa top_concepts
W3160856016 How to conduct a bibliometric analysis: An overview and guidelines Naveen Donthu Weng Marc Lim FALSE Bibliometrics, Field (mathematics), Resource (disambiguation)
W3001491100 Software tools for conducting bibliometric analysis in science: An up-to-date review José A. Moral-Muñoz Manuel J. Cobo TRUE Bibliometrics, Visualization, Set (abstract data type)
W3044902155 Financial literacy: A systematic review and bibliometric analysis Kirti Goyal Satish Kumar FALSE Financial literacy, Citation, Content analysis
W3038273726 Investigating the emerging COVID-19 research trends in the field of business and management: A bibliometric analysis approach Surabhi Verma Anders Gustafsson FALSE Bibliometrics, Field (mathematics), Disease
W3198357836 Artificial intelligence and machine learning in finance: Identifying foundations, themes, and research clusters from bibliometric analysis John W. Goodell Debidutta Pattnaik FALSE Scholarship, Valuation (finance), Corporate finance
W2998021954 Bibliometric Analysis using Bibliometrix an R Package Hamid Derviş NA TRUE Bibliometrics, Citation, Field (mathematics)

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 A5069892096 and A5023888391.

oa_fetch(
  identifier = c("A5069892096", "A5023888391"),
  verbose = TRUE
) %>%
  show_authors() %>%
  knitr::kable()
## Requesting url:
## <https://api.openalex.org/authors?filter=openalex%3AA5069892096%7CA5023888391>
## ℹ Getting 1 page of results with a total of 2 records...
id display_name orcid works_count cited_by_count top_concepts
A5069892096 Massimo Aria 0000-0002-8517-9411 240 30487 General Dentistry, Library and Information Sciences, Information Systems
A5023888391 Jason R Priem 0000-0001-6187-6610 50 7710 Library and Information Sciences, Library and Information Sciences, Information Systems

Example: We want to 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_institutions.id = "I71267560",
  works_count = ">499"
  )

do.call(oa_fetch, c(my_arguments, list(count_only = TRUE)))
## $count
## [1] 133
## 
## $db_response_time_ms
## [1] 16
## 
## $page
## [1] 1
## 
## $per_page
## [1] 1
## 
## $groups_count
## NULL
## 
## $x_query
## $x_query$oql
## [1] "get authors with a works count above 499 where exact last known institution is (I71267560)"
## 
## $x_query$x_new_oql
## [1] "get authors with a works count above 499 where exact last known institution is (I71267560)"
## 
## $x_query$oqo
## $x_query$oqo$get_rows
## [1] "authors"
## 
## $x_query$oqo$filter_rows
## $x_query$oqo$filter_rows[[1]]
## $x_query$oqo$filter_rows[[1]]$column_id
## [1] "last_known_institutions.id"
## 
## $x_query$oqo$filter_rows[[1]]$value
## [1] "I71267560"
## 
## 
## $x_query$oqo$filter_rows[[2]]
## $x_query$oqo$filter_rows[[2]]$column_id
## [1] "works_count"
## 
## $x_query$oqo$filter_rows[[2]]$value
## [1] 499
## 
## $x_query$oqo$filter_rows[[2]]$operator
## [1] ">"
## 
## 
## 
## 
## $x_query$url
## [1] "/authors?filter=last_known_institutions.id:I71267560,works_count:%3E499&per_page=1"
## 
## $x_query$order
## [1] "most works first"
## 
## $x_query$order_default
## [1] TRUE
## 
## 
## $cost_usd
## [1] 1e-04
do.call(oa_fetch, my_arguments) %>% 
  show_authors() %>%
  knitr::kable()
id display_name orcid works_count cited_by_count top_concepts
A5107859359 P. Paolucci 0000-0002-8773-4781 3988 237109 Nuclear and High Energy Physics, Nuclear and High Energy Physics, Nuclear and High Energy Physics
A5114377868 L. Lista 0000-0001-6471-5492 3809 247187 Nuclear and High Energy Physics, Nuclear and High Energy Physics, Nuclear and High Energy Physics
A5106552509 C. Sciacca 0000-0002-8412-4072 3338 176133 Nuclear and High Energy Physics, Nuclear and High Energy Physics, Nuclear and High Energy Physics
A5107872327 Fabio Anulli 0000-0003-2734-130X 2328 210671 Nuclear and High Energy Physics, Nuclear and High Energy Physics, Nuclear and High Energy Physics
A5058486387 P. Iengo 0000-0002-5035-1242 2227 215503 Nuclear and High Energy Physics, Nuclear and High Energy Physics, Nuclear and High Energy Physics
A5080364444 M. Della Pietra 0000-0003-4446-3368 2199 214394 Nuclear and High Energy Physics, Nuclear and High Energy Physics, Nuclear and High Energy Physics

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

oa_fetch(
  entity = "authors",
  display_name.search = "Massimo Aria",
  has_orcid = "true"
) %>%
  show_authors() %>%
  knitr::kable()
id display_name orcid works_count cited_by_count top_concepts
A5069892096 Massimo Aria 0000-0002-8517-9411 240 30487 General Dentistry, Library and Information Sciences, Information Systems
oa_fetch(
  entity = "authors",
  orcid = "0000-0002-8517-9411"
) %>%
  show_authors() %>%
  knitr::kable()
id display_name orcid works_count cited_by_count top_concepts
A5069892096 Massimo Aria 0000-0002-8517-9411 240 30487 General Dentistry, Library and Information Sciences, Information Systems

Institutions

Example: We want to 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
## [1] 261
## 
## $db_response_time_ms
## [1] 1
## 
## $page
## [1] 1
## 
## $per_page
## [1] 1
## 
## $groups_count
## NULL
## 
## $x_query
## $x_query$oql
## [1] "get institutions in [Italy](IT) where institution type is (education)"
## 
## $x_query$x_new_oql
## [1] "get institutions in [Italy](IT) where institution type is (education)"
## 
## $x_query$oqo
## $x_query$oqo$get_rows
## [1] "institutions"
## 
## $x_query$oqo$filter_rows
## $x_query$oqo$filter_rows[[1]]
## $x_query$oqo$filter_rows[[1]]$column_id
## [1] "country_code"
## 
## $x_query$oqo$filter_rows[[1]]$value
## [1] "IT"
## 
## 
## $x_query$oqo$filter_rows[[2]]
## $x_query$oqo$filter_rows[[2]]$column_id
## [1] "type"
## 
## $x_query$oqo$filter_rows[[2]]$value
## [1] "education"
## 
## 
## 
## 
## $x_query$url
## [1] "/institutions?filter=country_code:IT,type:education&per_page=1"
## 
## $x_query$order
## [1] "most works first"
## 
## $x_query$order_default
## [1] TRUE
## 
## 
## $cost_usd
## [1] 1e-04
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 261 records...
## Rows: 261
## Columns: 23
## $ id                         <chr> "https://openalex.org/I189158943", "https:/…
## $ display_name               <chr> "University of Milan", "Sapienza University…
## $ display_name_alternatives  <list> <"Statale", "Universitat de Milà", "Univer…
## $ display_name_acronyms      <list> "UNIMI", NA, NA, "UNIBO", "UNIPD", "UniPi"…
## $ international_display_name <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
## $ ror                        <chr> "https://ror.org/00wjc7c48", "https://ror.o…
## $ ids                        <list> <"https://openalex.org/I189158943", "https…
## $ country_code               <chr> "IT", "IT", "IT", "IT", "IT", "IT", "IT", "…
## $ geo                        <list> [<data.frame[1 x 7]>], [<data.frame[1 x 7]…
## $ type                       <chr> "education", "education", "education", "edu…
## $ homepage_url               <chr> "https://www.unimi.it", "https://www.unirom…
## $ image_url                  <chr> "https://commons.wikimedia.org/w/index.php?…
## $ image_thumbnail_url        <chr> "https://commons.wikimedia.org/w/index.php?…
## $ associated_institutions    <list> [<data.frame[6 x 6]>], [<data.frame[4 x 6]…
## $ works_count                <int> 376892, 280705, 256027, 238615, 220441, 205…
## $ cited_by_count             <int> 8406676, 8713830, 3030528, 7367715, 7854325…
## $ counts_by_year             <list> [<data.frame[17 x 4]>], [<data.frame[17 x …
## $ summary_stats              <list> <4.917423e+00, 7.720000e+02, 1.128790e+05>…
## $ status                     <chr> "active", "active", "active", "active", "ac…
## $ works_api_url              <chr> "https://api.openalex.org/works?filter=inst…
## $ topics                     <list> [<tbl_df[100 x 5]>], [<tbl_df[100 x 5]>], …
## $ updated_date               <chr> "2026-12-01T18:21:22", "2026-12-01T18:21:22…
## $ created_date               <chr> "2016-06-24T00:00:00", "2016-06-24T00:00:00…

Keywords

Example: We want to download the records of all the keywords that more than 1000 works were tagged with:

popular_keywords <- list(
  entity = "keywords",
  works_count = ">1000000",
  verbose = TRUE
)

do.call(oa_fetch, c(popular_keywords, list(count_only = TRUE)))
## Requesting url:
## <https://api.openalex.org/keywords?filter=works_count%3A%3E1000000>
## $count
## [1] 26
## 
## $db_response_time_ms
## [1] 4
## 
## $page
## [1] 1
## 
## $per_page
## [1] 1
## 
## $groups_count
## NULL
## 
## $x_query
## $x_query$oql
## [1] "get keywords with a works count above 1,000,000"
## 
## $x_query$x_new_oql
## [1] "get keywords with a works count above 1,000,000"
## 
## $x_query$oqo
## $x_query$oqo$get_rows
## [1] "keywords"
## 
## $x_query$oqo$filter_rows
## $x_query$oqo$filter_rows[[1]]
## $x_query$oqo$filter_rows[[1]]$column_id
## [1] "works_count"
## 
## $x_query$oqo$filter_rows[[1]]$value
## [1] 1000000
## 
## $x_query$oqo$filter_rows[[1]]$operator
## [1] ">"
## 
## 
## 
## 
## $x_query$url
## [1] "/keywords?filter=works_count:%3E1000000&per_page=1"
## 
## $x_query$order
## [1] "most works first"
## 
## $x_query$order_default
## [1] TRUE
## 
## 
## $cost_usd
## [1] 1e-04
dplyr::glimpse(do.call(oa_fetch, popular_keywords))
## Requesting url:
## <https://api.openalex.org/keywords?filter=works_count%3A%3E1000000>
## ℹ Getting 1 page of results with a total of 26 records...
## Rows: 26
## Columns: 12
## $ id                        <chr> "https://openalex.org/keywords/large-helical…
## $ display_name              <chr> "Large Helical Device", "neutral beam inject…
## $ description               <chr> "A superconducting stellarator fusion resear…
## $ display_name_alternatives <list> ["LHD"], ["NBI"], ["Doppler backscattering"…
## $ ids                       <list> ["https://openalex.org/keywords/large-helic…
## $ primary_topic             <list> ["https://openalex.org/T10346", "Magnetic c…
## $ topics                    <list> [["https://openalex.org/T10346", "Magnetic …
## $ works_count               <int> 11915066, 5317752, 3420705, 2137326, 1899485…
## $ cited_by_count            <int> 71781, 112146, 7712, 19021, 12751, 19273983,…
## $ works_api_url             <chr> "https://api.openalex.org/works?filter=keywo…
## $ updated_date              <chr> "2026-12-01T02:07:42", "2026-12-01T02:07:42"…
## $ created_date              <chr> "2022-04-12T19:38:12", "2022-04-12T19:38:12"…

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
## [1] 22936
## 
## $db_response_time_ms
## [1] 53
## 
## $page
## [1] 1
## 
## $per_page
## [1] 1
## 
## $groups_count
## NULL
## 
## $x_query
## $x_query$oql
## [1] "get works citing (W2755950973)"
## 
## $x_query$x_new_oql
## [1] "get works citing (W2755950973)"
## 
## $x_query$oqo
## $x_query$oqo$get_rows
## [1] "works"
## 
## $x_query$oqo$filter_rows
## $x_query$oqo$filter_rows[[1]]
## $x_query$oqo$filter_rows[[1]]$column_id
## [1] "referenced_works"
## 
## $x_query$oqo$filter_rows[[1]]$value
## [1] "W2755950973"
## 
## 
## 
## 
## $x_query$url
## [1] "/works?filter=referenced_works:W2755950973&per_page=1"
## 
## $x_query$order
## [1] "most cited (age-adjusted) first"
## 
## $x_query$order_default
## [1] TRUE
## 
## 
## $cost_usd
## [1] 1e-04

This query will return a collection of 22936 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 37 records...
## Rows: 37
## Columns: 44
## $ id                            <chr> "https://openalex.org/W2896801517", "htt…
## $ title                         <chr> "Global trends in infectious diseases of…
## $ display_name                  <chr> "Global trends in infectious diseases of…
## $ authorships                   <list> [<tbl_df[2 x 9]>], [<tbl_df[3 x 9]>], […
## $ abstract                      <chr> "Pork accounts for more than one-third o…
## $ doi                           <chr> "https://doi.org/10.1073/pnas.1806068115…
## $ publication_date              <date> 2018-10-22, 2018-12-26, 2018-12-20, 201…
## $ publication_year              <int> 2018, 2018, 2018, 2018, 2018, 2018, 2018…
## $ fwci                          <dbl> 20.8342, 42.9982, 3.9658, 17.8040, 33.74…
## $ cited_by_count                <int> 377, 377, 310, 181, 159, 156, 121, 121, …
## $ counts_by_year                <list> [<data.frame[9 x 2]>], [<data.frame[10 …
## $ ids                           <list> <"https://openalex.org/W2896801517", "h…
## $ type                          <chr> "article", "article", "review", "article…
## $ is_oa                         <lgl> TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, …
## $ is_oa_anywhere                <lgl> TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRU…
## $ oa_status                     <chr> "bronze", "green", "green", "closed", "g…
## $ oa_url                        <chr> "https://www.pnas.org/content/pnas/115/4…
## $ any_repository_has_fulltext   <lgl> TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRU…
## $ source_display_name           <chr> "Proceedings of the National Academy of …
## $ source_id                     <chr> "https://openalex.org/S125754415", "http…
## $ issn_l                        <chr> "0027-8424", "0007-1013", "0169-5347", "…
## $ host_organization             <chr> "https://openalex.org/P4310320052", "htt…
## $ host_organization_name        <chr> "National Academy of Sciences", "Wiley",…
## $ landing_page_url              <chr> "https://doi.org/10.1073/pnas.1806068115…
## $ pdf_url                       <chr> "https://www.pnas.org/content/pnas/115/4…
## $ license                       <chr> NA, NA, NA, NA, "cc-by", NA, "cc-by", NA…
## $ version                       <chr> "publishedVersion", "publishedVersion", …
## $ referenced_works              <list> <"https://openalex.org/W2088925604", "h…
## $ referenced_works_count        <int> 15, 246, 94, 69, 77, 219, 17, 56, 132, 6…
## $ related_works                 <list> <"https://openalex.org/W82750099", "htt…
## $ concepts                      <list> [<data.frame[26 x 5]>], [<data.frame[17…
## $ topics                        <list> [<tbl_df[12 x 5]>], [<tbl_df[12 x 5]>],…
## $ keywords                      <list> [<data.frame[9 x 3]>], [<data.frame[13 …
## $ is_paratext                   <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ is_retracted                  <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ language                      <chr> "en", "en", "en", "en", "en", "en", "en"…
## $ sustainable_development_goals <list> [<data.frame[2 x 3]>], [<data.frame[1 x…
## $ awards                        <list> <"https://openalex.org/G8960896466", "2…
## $ funders                       <list> [<data.frame[2 x 3]>], [<data.frame[3 x…
## $ apc                           <list> NA, [<data.frame[2 x 5]>], [<data.frame…
## $ first_page                    <chr> "11495", "12", "224", "308", "e0207655",…
## $ last_page                     <chr> "11500", "63", "238", "327", "e0207655",…
## $ volume                        <chr> "115", "50", "34", "45", "13", "205", "1…
## $ issue                         <chr> "45", "1", "3", "3", "11", NA, "6", "12"…

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
## [1] 416
## 
## $db_response_time_ms
## [1] 17
## 
## $page
## [1] 1
## 
## $per_page
## [1] 1
## 
## $groups_count
## NULL
## 
## $x_query
## $x_query$oql
## [1] "get works from 2022-01-01 through 2022-03-31 citing (W2755950973)"
## 
## $x_query$x_new_oql
## [1] "get works from 2022-01-01 through 2022-03-31 citing (W2755950973)"
## 
## $x_query$oqo
## $x_query$oqo$get_rows
## [1] "works"
## 
## $x_query$oqo$filter_rows
## $x_query$oqo$filter_rows[[1]]
## $x_query$oqo$filter_rows[[1]]$column_id
## [1] "from_publication_date"
## 
## $x_query$oqo$filter_rows[[1]]$value
## [1] "2022-01-01"
## 
## 
## $x_query$oqo$filter_rows[[2]]
## $x_query$oqo$filter_rows[[2]]$column_id
## [1] "referenced_works"
## 
## $x_query$oqo$filter_rows[[2]]$value
## [1] "W2755950973"
## 
## 
## $x_query$oqo$filter_rows[[3]]
## $x_query$oqo$filter_rows[[3]]$column_id
## [1] "to_publication_date"
## 
## $x_query$oqo$filter_rows[[3]]$value
## [1] "2022-03-31"
## 
## 
## 
## 
## $x_query$url
## [1] "/works?filter=from_publication_date:2022-01-01,referenced_works:W2755950973,to_publication_date:2022-03-31&per_page=1"
## 
## $x_query$order
## [1] "most cited (age-adjusted) first"
## 
## $x_query$order_default
## [1] TRUE
## 
## 
## $cost_usd
## [1] 1e-04
do.call(oa_fetch, bib_ls) %>% 
  oa2bibliometrix() %>% 
  dplyr::glimpse()
## Warning in oa2bibliometrix(.): oa2bibliometrix() is deprecated. Please use
## bibliometrix::convert2df() instead.
## Rows: 416
## Columns: 60
## $ AU                            <chr> "MASSIMO ARIA;CORRADO CUCCURULLO;LUCA D’…
## $ RP                            <chr> "DEPARTMENT OF ECONOMICS AND STATISTICS,…
## $ C1                            <chr> "DEPARTMENT OF ECONOMICS AND STATISTICS,…
## $ AU_UN                         <chr> "UNIVERSITY OF NAPLES FEDERICO II;C(\"UN…
## $ AU_CO                         <chr> "ITALY;ITALY;ITALY;ITALY;ITALY;ITALY", "…
## $ ID                            <chr> "PERSONALIZATION;BIBLIOMETRICS;KNOWLEDGE…
## $ id_url                        <chr> "https://openalex.org/W4220923293", "htt…
## $ title                         <chr> "Artificial intelligence in E-Commerce: …
## $ authorships                   <list> [<tbl_df[4 x 9]>], [<tbl_df[5 x 9]>], […
## $ abstract                      <chr> NA, "The study aims to identify the curr…
## $ doi                           <chr> "https://doi.org/10.1007/s12525-022-0053…
## $ publication_date              <date> 2022-03-01, 2022-02-09, 2022-03-29, 202…
## $ fwci                          <dbl> 47.3425, 43.2585, 5.0226, 7.1270, 3.8694…
## $ counts_by_year                <list> [<data.frame[6 x 2]>], [<data.frame[6 x…
## $ ids                           <list> <"https://openalex.org/W4220923293", "h…
## $ is_oa                         <lgl> FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, …
## $ is_oa_anywhere                <lgl> TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, T…
## $ oa_status                     <chr> "green", "closed", "gold", "hybrid", "cl…
## $ oa_url                        <chr> "https://pmc.ncbi.nlm.nih.gov/articles/P…
## $ any_repository_has_fulltext   <lgl> TRUE, FALSE, FALSE, FALSE, FALSE, FALSE,…
## $ source_display_name           <chr> "Electronic Markets", "International Jou…
## $ source_id                     <chr> "https://openalex.org/S137519996", "http…
## $ issn_l                        <chr> "1019-6781", "0020-7543", "2073-4441", "…
## $ host_organization             <chr> "https://openalex.org/P4310319900", "htt…
## $ host_organization_name        <chr> "Springer Science+Business Media", "Tayl…
## $ landing_page_url              <chr> "https://doi.org/10.1007/s12525-022-0053…
## $ pdf_url                       <chr> NA, NA, "https://www.mdpi.com/2073-4441/…
## $ license                       <chr> NA, NA, "cc-by", "cc-by-nc-nd", NA, NA, …
## $ version                       <chr> "publishedVersion", "publishedVersion", …
## $ referenced_works              <list> <"https://openalex.org/W52770770", "htt…
## $ referenced_works_count        <int> 401, 152, 41, 187, 88, 81, 57, 79, 137, …
## $ related_works                 <list> <"https://openalex.org/W4402290360", "h…
## $ concepts                      <list> [<data.frame[9 x 5]>], [<data.frame[12 …
## $ topics                        <list> [<tbl_df[12 x 5]>], [<tbl_df[12 x 5]>],…
## $ keywords                      <list> [<data.frame[10 x 3]>], [<data.frame[11…
## $ is_paratext                   <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ is_retracted                  <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ language                      <chr> "en", "en", "en", "en", "en", "en", "en"…
## $ sustainable_development_goals <list> NA, [<data.frame[1 x 3]>], [<data.frame…
## $ awards                        <list> NA, NA, NA, NA, <"https://openalex.org/…
## $ funders                       <list> NA, NA, [<data.frame[2 x 3]>], NA, [<da…
## $ apc                           <list> [<data.frame[2 x 5]>], NA, [<data.frame…
## $ first_page                    <chr> "297", "7527", "1073", "1129", "133932",…
## $ last_page                     <chr> "338", "7550", "1073", "1155", "133932",…
## $ volume                        <chr> "32", "60", "14", "39", "297", "30", "14…
## $ issue                         <chr> "1", "24", "7", "6", NA, "2", "6", NA, "…
## $ id_oa                         <chr> "W4220923293", "W4210997151", "W42209621…
## $ CR                            <chr> "W52770770;W198744195;W265896103;W281665…
## $ TI                            <chr> "ARTIFICIAL INTELLIGENCE IN E-COMMERCE: …
## $ AB                            <chr> NA, "THE STUDY AIMS TO IDENTIFY THE CURR…
## $ SO                            <chr> "ELECTRONIC MARKETS", "INTERNATIONAL JOU…
## $ DT                            <chr> "ARTICLE", "ARTICLE", "REVIEW", "REVIEW"…
## $ DB                            <chr> "OPENALEX", "OPENALEX", "OPENALEX", "OPE…
## $ JI                            <chr> "S137519996", "S65690446", "S134216166",…
## $ J9                            <chr> "S137519996", "S65690446", "S134216166",…
## $ PY                            <int> 2022, 2022, 2022, 2022, 2022, 2022, 2022…
## $ TC                            <int> 636, 537, 402, 349, 331, 264, 254, 244, …
## $ DI                            <chr> "10.1007/s12525-022-00537-z", "10.1080/0…
## $ SR_FULL                       <chr> "MASSIMO ARIA, 2022, ELECTRONIC MARKETS"…
## $ SR                            <chr> "MASSIMO ARIA, 2022, ELECTRONIC MARKETS"…

About OpenAlex

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

  • 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.