{"id":14066938,"url":"https://github.com/KTH-Library/openalex","last_synced_at":"2025-07-30T00:31:45.813Z","repository":{"id":100769048,"uuid":"451819144","full_name":"KTH-Library/openalex","owner":"KTH-Library","description":"R package to provide data access to OpenAlex by way of REST API","archived":false,"fork":false,"pushed_at":"2025-05-08T09:16:05.000Z","size":5269,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-08T10:27:31.233Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://kth-library.github.io/openalex/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KTH-Library.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-25T09:46:11.000Z","updated_at":"2025-03-07T07:34:24.000Z","dependencies_parsed_at":"2025-02-05T17:34:54.391Z","dependency_job_id":"d9dbb25b-adca-4dd0-9a71-066d9a0380de","html_url":"https://github.com/KTH-Library/openalex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KTH-Library/openalex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH-Library%2Fopenalex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH-Library%2Fopenalex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH-Library%2Fopenalex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH-Library%2Fopenalex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KTH-Library","download_url":"https://codeload.github.com/KTH-Library/openalex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH-Library%2Fopenalex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267785735,"owners_count":24144120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:05:20.514Z","updated_at":"2025-07-30T00:31:45.226Z","avatar_url":"https://github.com/KTH-Library.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\"\n)\n```\n\n# openalex\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![R-CMD-check](https://github.com/KTH-Library/openalex/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/KTH-Library/openalex/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nThe goal of `openalex` is to provide access to data from [OpenAlex](https://openalex.org) - an open and comprehensive catalog of scholarly papers, authors, institutions and more ... - to R through the [Open Alex REST API](https://docs.openalex.org/api)...\n\n## Installation\n\nYou can install the current version of `openalex` from [GitHub](https://github.com/kth-library/openalex) with:\n\n``` r\n#install.packages(\"devtools\")\ndevtools::install_github(\"kth-library/openalex\", dependencies = TRUE)\n```\n\n## Example\n\nThis is a basic example which shows you how to get information for papers and authors:\n\n```{r example, eval=TRUE}\n\nlibrary(openalex)\nlibrary(dplyr)\nsuppressPackageStartupMessages(library(purrr))\nlibrary(knitr)\n\niid \u003c- \n  openalex:::openalex_autocomplete(\n    query = \"Royal Institute of Technology\", \n    entity_type = \"institution\", \n    format = \"table\") |\u003e \n  head(1) |\u003e \n  pull(\"id\")\n\ndata \u003c- \n  openalex_crawl(entity = \"works\", verbose = TRUE, fmt = \"tables\",\n    query = openalex:::openalex_query(filter =\n      sprintf(\"institutions.id:%s,publication_year:2025\", iid)))\n\nres \u003c- data |\u003e map(head)  # return only first six rows from each table\n\nres\n```\n\n## Rate limits and using an API key\n\nBy providing an email address you enter the \"polite pool\" which provides even less of rate limiting for API requests.\n\nYou can provide it in `~/.Renviron` by setting `OPENALEX_USERAGENT=http://github.com/hadley/httr (mailto:your_email@your_institution.org)`.\n\nYou can also set it just for the session by using a helper fcn `openalex_polite()` to temporarily set or unset the email used in the user agent string when making API requests:\n\n```{r polite}\nlibrary(openalex)\n\n# set an email to use for the session\n\nopenalex_polite(\"you@example.com\")\n\n# unset, and use default user agent string...\n\nopenalex_polite(\"\")\n\n```\n\nA premium subscription API key can be used by setting `OPENALEX_KEY=secret_premium_api_key` in your `.Renviron`, or temporarily in a session using:\n\n```{r premium, eval = FALSE}\nlibrary(openalex)\n\n# temporarily use a premium subscription API key\nopenalex_key(\"secret_premium_api_key\")\n\n# unset to not use the premium subscription API key\nopenalex_key(\"\")\n\n```\n\nThis will make it possible to make API calls that return the latest available records, for example based on recent creation dates or recent last modification timestamps.\n\n```{r updates, eval = TRUE}\n\n# we do not require an API key for the publish date\npublished_since_ \u003c- openalex_works_published_since(since_days = 7)\n\n# but an API key is needed when using \"from_created_date\" and \"from_updated_date\" fields.\ncreated_since_7d \u003c- openalex_works_created_since(since_days = 7)\nupdated_since_1h \u003c- openalex_works_updated_since(since_minutes = 60)\n\n# first few rows of each of these retrievals\ncreated_since_7d |\u003e _$work_ids |\u003e head() |\u003e knitr::kable()\nupdated_since_1h |\u003e _$work_ids |\u003e head() |\u003e knitr::kable()\n\n```\n\n\n## Data source attribution\n\nWhen data from `openalex` is displayed publicly, this attribution also needs to be displayed:\n\n```{r attribution}\nlibrary(openalex)\nopenalex_attribution()\n```\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKTH-Library%2Fopenalex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKTH-Library%2Fopenalex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKTH-Library%2Fopenalex/lists"}