From 18201e608b848cbff4c24fe5c28e35488157d0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 22 Oct 2024 16:07:01 +0200 Subject: [PATCH] fix function name --- browse/api.qmd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/browse/api.qmd b/browse/api.qmd index 51a1f87..fddd752 100644 --- a/browse/api.qmd +++ b/browse/api.qmd @@ -17,6 +17,30 @@ On this page we'll show examples using {httr2} or {universe} directly. The URL of these APIs start with the universe URL. Here we will often use `https://jeroen.r-universe.dev` as an example but you can replace it with any universe URL. +### List of all universes + +URL: `https://r-universe.dev/stats/everyone` + +Example + +```{r} +universes <- httr2::request("https://r-universe.dev/stats/everyone") |> + httr2::req_user_agent("R-universe docs") |> + httr2::req_perform() |> + httr2::resp_body_json() +str(universes, max.level = 1) +head(universes[["universes"]]) +head(universes[["maintainers"]]) +``` + +Or: + +```{r} +universe::everyone() |> head() +universe::everyone(type = "universes") |> head() +universe::everyone(type = "maintainers") |> head() +``` + ### List of packages in an universe {#ls} URL: `https://.r-universe.dev/api/ls`