Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Comment thread
maelle marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions content/blog/2026-06-04-r-universe-api/index.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: An API for Everything There Is to Know About Packages
author:
- Maëlle Salmon
editor:
date: '2026-06-04'
Comment thread
maelle marked this conversation as resolved.
Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delay, you'll need to update the publication date

slug: r-universe-apis-use-cases
description: Use cases of the R-universe APIs
Comment thread
maelle marked this conversation as resolved.
Outdated
tags:
- tech notes
- r-universe
Comment thread
maelle marked this conversation as resolved.
params:
doi: "10.59350/vrv9q-27605"
output: hugodown::md_document
---

R-universe, our platform for improving publication and discovery of research software in R, not only provides a human-friendly website, but also programmatic access through APIs!
Thanks to those APIs you can list universes, packages in an universe, get information on packages, perform searches, without any need for authentication.
Comment thread
maelle marked this conversation as resolved.
Outdated

The APIs are both handy and reliable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ours might be reliable, but I don't think that's an inherent property of APIs in general 😅

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you think I should remove this sentence?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or add "R-Universe" to be clear that we're talking about specific R-Universe APIs. I think I got confused by the plural APIs: I'm used to thinking about the R-Universe having one API with multiple end points. So when I read "APIs" I assumed it was a general statement.

You can build upon them, as both rOpenSci and community members have done.
In this post, we provide a short overview of use cases.
Comment thread
maelle marked this conversation as resolved.
Outdated


## Know what packages are yours
Comment thread
maelle marked this conversation as resolved.
Outdated

The toolbox for community management tasks, [promoutils](https://ropensci.r-universe.dev/promoutils), calls an R-universe API to get information, and the list of, [rOpenSci packages](https://github.com/ropensci-org/promoutils/blob/18c80362002bafe48c7c88c1ca062ac3a3050358/R/utils.R#L25).
Comment thread
maelle marked this conversation as resolved.
Outdated
This list of packages is in particular used in the [function](https://github.com/ropensci-org/promoutils/blob/18c80362002bafe48c7c88c1ca062ac3a3050358/R/help_wanted_json.R#L48) that outputs data on [help-wanted issues](/help-wanted).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually broken right now 😢. If you don't mind waiting a bit, I can fix it before you publish?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll wait!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! motivation to get it done!


## Display packages developed at your organization

If your organization develop R packages, you can use its R-universe as the source of truth of the collection of packages.
For instance, the [R-universe of ggsegverse](https://ggsegverse.r-universe.dev/builds) corresponds to, well, the ggsegverse.
Therefore, on ggsegverse website, the [listing of packages](https://ggsegverse.github.io/ecosystem/) is created by querying `https://ggsegverse.r-universe.dev/api/packages`, the endpoint for [information on all packages in the universe](https://docs.r-universe.dev/browse/api.html#information-of-all-packages-in-an-universe).
Comment thread
maelle marked this conversation as resolved.
Outdated

```{=html}
{{< figure src="ggsegverse.png" alt="Screenshot of the ggsegverse website, with informative package cards" link="https://ggsegverse.github.io/ecosystem/" >}}
```

Likewise, the [docs page](https://ggsegverse.github.io/docs/) of ggsegverse relies on the R-universe API to get vignettes for each package.
Comment thread
maelle marked this conversation as resolved.
Outdated
Comment thread
maelle marked this conversation as resolved.
Outdated

### Server-side or client-side API requests

The ggsegverse website perform **client-side requests**:
it queries the R-universe API when you open the webpage, through a [JS script](https://github.com/ggsegverse/ggsegverse.github.io/blob/aea3723f885387ca9399408ccfbcc7a1ec9d7820/js/api.js).
Comment thread
maelle marked this conversation as resolved.
Outdated
You can also check this through the [web developer tools](https://inspectelement.org/apis.html#how-to-find-and-use-undocumented-apis):

```{=html}
{{< figure src="request.png" alt="Screenshot of the web developer tools' network tab, showing the XHR request logged when one reloads the ggsegverse website" >}}
```

The rendering of the nice package cards happens through [another JS script](https://github.com/ggsegverse/ggsegverse.github.io/blob/fec52718432d098b1162772f3f94985a1d0feef3/js/render.js) that uses information such as the package's title, description, number of stars, etc.

The rOpenSci website uses, for the package listings on the author pages and packages pages, **server-side requests**: the API is called when Hugo renders our website.
For instance, for the list of packages at the bottom of [Jeroen Ooms' author page](https://ropensci.org/author/jeroen-ooms/), we [query](https://github.com/ropensci/roweb3/blob/503f0547854925eaa72a0e2c36420e3731e98ebf/themes/ropensci/layouts/author/list.html#L84) the R-universe API link from our website [configuration](https://github.com/ropensci/roweb3/blob/7851904c5297868b7c372788166c526f2fe2ed1d/config.toml#L60) and [filter](https://github.com/ropensci/roweb3/blob/503f0547854925eaa72a0e2c36420e3731e98ebf/themes/ropensci/layouts/author/list.html#L85) the packages for which the maintainer's GitHub login is the same as the GitHub username of the person.
Comment thread
maelle marked this conversation as resolved.
Outdated

```{=html}
{{< figure src="jeroen.png" alt="Screenshot of Jeroen Ooms' author page on the rOpenSci website, featuring the list of rOpenSci packages that he maintains." >}}
```

On a Quarto website, you could have a code chunk using R to query the R-universe APIs, through the [universe R package](https://docs.ropensci.org/universe/) for instance.
Comment thread
maelle marked this conversation as resolved.
Outdated

In any case, if you use server-side requests, you need to re-render your website fairly regularly to avoid your packages' listing to get out-of-date.
Comment thread
maelle marked this conversation as resolved.
Outdated


## Conclusion

In this post we provided some use cases of the R-universe APIs.
Comment thread
maelle marked this conversation as resolved.
Outdated
Try them out, or read the [docs](https://docs.r-universe.dev/browse/api.html) to get a sense of all the information that's shared through the different endpoints.
If you maintain some infrastructure that uses an API of R-Universe's, feel free to report an [use case](/usecases)!
Comment thread
maelle marked this conversation as resolved.
Outdated
54 changes: 54 additions & 0 deletions content/blog/2026-06-04-r-universe-api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: An API for Everything There Is to Know About Packages
author:
- Maëlle Salmon
editor:
date: '2026-06-04'
slug: r-universe-apis-use-cases
description: Use cases of the R-universe APIs
tags:
- tech notes
- r-universe
params:
doi: "10.59350/vrv9q-27605"
output: hugodown::md_document
rmd_hash: fb2e953bf7d04c4d

---

R-universe, our platform for improving publication and discovery of research software in R, not only provides a human-friendly website, but also programmatic access through APIs! Thanks to those APIs you can list universes, packages in an universe, get information on packages, perform searches, without any need for authentication.

The APIs are both handy and reliable. You can build upon them, as both rOpenSci and community members have done. In this post, we provide a short overview of use cases.

## Know what packages are yours

The toolbox for community management tasks, [promoutils](https://ropensci.r-universe.dev/promoutils), calls an R-universe API to get information, and the list of, [rOpenSci packages](https://github.com/ropensci-org/promoutils/blob/18c80362002bafe48c7c88c1ca062ac3a3050358/R/utils.R#L25). This list of packages is in particular used in the [function](https://github.com/ropensci-org/promoutils/blob/18c80362002bafe48c7c88c1ca062ac3a3050358/R/help_wanted_json.R#L48) that outputs data on [help-wanted issues](/help-wanted).

## Display packages developed at your organization

If your organization develop R packages, you can use its R-universe as the source of truth of the collection of packages. For instance, the [R-universe of ggsegverse](https://ggsegverse.r-universe.dev/builds) corresponds to, well, the ggsegverse. Therefore, on ggsegverse website, the [listing of packages](https://ggsegverse.github.io/ecosystem/) is created by querying `https://ggsegverse.r-universe.dev/api/packages`, the endpoint for [information on all packages in the universe](https://docs.r-universe.dev/browse/api.html#information-of-all-packages-in-an-universe).

{{< figure src="ggsegverse.png" alt="Screenshot of the ggsegverse website, with informative package cards" link="https://ggsegverse.github.io/ecosystem/" >}}

Likewise, the [docs page](https://ggsegverse.github.io/docs/) of ggsegverse relies on the R-universe API to get vignettes for each package.

### Server-side or client-side API requests

The ggsegverse website perform **client-side requests**: it queries the R-universe API when you open the webpage, through a [JS script](https://github.com/ggsegverse/ggsegverse.github.io/blob/aea3723f885387ca9399408ccfbcc7a1ec9d7820/js/api.js). You can also check this through the [web developer tools](https://inspectelement.org/apis.html#how-to-find-and-use-undocumented-apis):

{{< figure src="request.png" alt="Screenshot of the web developer tools' network tab, showing the XHR request logged when one reloads the ggsegverse website" >}}

The rendering of the nice package cards happens through [another JS script](https://github.com/ggsegverse/ggsegverse.github.io/blob/fec52718432d098b1162772f3f94985a1d0feef3/js/render.js) that uses information such as the package's title, description, number of stars, etc.

The rOpenSci website uses, for the package listings on the author pages and packages pages, **server-side requests**: the API is called when Hugo renders our website. For instance, for the list of packages at the bottom of [Jeroen Ooms' author page](https://ropensci.org/author/jeroen-ooms/), we [query](https://github.com/ropensci/roweb3/blob/503f0547854925eaa72a0e2c36420e3731e98ebf/themes/ropensci/layouts/author/list.html#L84) the R-universe API link from our website [configuration](https://github.com/ropensci/roweb3/blob/7851904c5297868b7c372788166c526f2fe2ed1d/config.toml#L60) and [filter](https://github.com/ropensci/roweb3/blob/503f0547854925eaa72a0e2c36420e3731e98ebf/themes/ropensci/layouts/author/list.html#L85) the packages for which the maintainer's GitHub login is the same as the GitHub username of the person.

{{< figure src="jeroen.png" alt="Screenshot of Jeroen Ooms' author page on the rOpenSci website, featuring the list of rOpenSci packages that he maintains." >}}

On a Quarto website, you could have a code chunk using R to query the R-universe APIs, through the [universe R package](https://docs.ropensci.org/universe/) for instance.

In any case, if you use server-side requests, you need to re-render your website fairly regularly to avoid your packages' listing to get out-of-date.

## Conclusion

In this post we provided some use cases of the R-universe APIs. Try them out, or read the [docs](https://docs.r-universe.dev/browse/api.html) to get a sense of all the information that's shared through the different endpoints. If you maintain some infrastructure that uses an API of R-Universe's, feel free to report an [use case](/usecases)!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more balanced screen shot would be prettier ✨

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.