On this page we’ll show examples using {httr2} or {universe} directly.
6.1 Universe-specific APIs
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.
limit: the number of results to return, by default a maximum of 100. You can use the ls endpoint to determine the total number of packages in the universe and set that as a limit.
Example:
packages <- httr2::request("https://jeroen.r-universe.dev/api/packages") |> httr2::req_user_agent("R-universe docs") |> httr2::req_perform() |> httr2::resp_body_json()# The result is a list of packagesstr(packages[[1]], max.level =1)
List of 75
$ Package : chr "curl"
$ Type : chr "Package"
$ Title : chr "A Modern and Flexible Web Client for R"
$ Version : chr "5.3.0"
$ Authors@R : chr "c(\nperson(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"[email protected]\",\ncomment = c(ORC"| __truncated__
$ Description : chr "The curl() and curl_download() functions provide highly\nconfigurable drop-in replacements for base url() and\n"| __truncated__
$ License : chr "MIT + file LICENSE"
$ SystemRequirements: chr "libcurl: libcurl-devel (rpm) or\nlibcurl4-openssl-dev (deb). Version 7.80 or up is recommended."
$ URL : chr "https://jeroen.r-universe.dev/curl https://curl.se/libcurl/"
$ BugReports : chr "https://github.com/jeroen/curl/issues"
$ VignetteBuilder : chr "knitr"
$ RoxygenNote : chr "7.3.2.9000"
$ Encoding : chr "UTF-8"
$ Language : chr "en-US"
$ Roxygen : chr "list(markdown = TRUE)"
$ Repository : chr "https://jeroen.r-universe.dev"
$ RemoteUrl : chr "https://github.com/jeroen/curl"
$ RemoteRef : chr "HEAD"
$ RemoteSha : chr "28cf6e3589a33b618ba7134842b8efbc45e31aa5"
$ NeedsCompilation : chr "yes"
$ Packaged :List of 2
$ Author : chr "Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>),\nHadley Wickham [ctb],\nRStudio [cph]"
$ Maintainer : chr "Jeroen Ooms <[email protected]>"
$ MD5sum : chr "61990cbc51b6eb2554c8c12ac83a017f"
$ _user : chr "jeroen"
$ _type : chr "src"
$ _file : chr "curl_5.3.0.tar.gz"
$ _fileid : chr "9418b47b7ebf968afa84be0da01dc4e5cbc1f8d842d8a1de1e58d9136a154c9d"
$ _filesize : int 523775
$ _sha256 : chr "9418b47b7ebf968afa84be0da01dc4e5cbc1f8d842d8a1de1e58d9136a154c9d"
$ _created : chr "2024-10-23T14:15:00.000Z"
$ _published : chr "2024-10-23T14:25:36.391Z"
$ _buildurl : chr "https://github.com/r-universe/jeroen/actions/runs/11481752355"
$ _status : chr "success"
$ _windevel : chr "failure"
$ _linuxdevel : chr "success"
$ _wasmbinary : chr "none"
$ _macbinary : chr "success"
$ _winbinary : chr "failure"
$ _pkgdocs : chr "skipped"
$ _upstream : chr "https://github.com/jeroen/curl"
$ _commit :List of 5
$ _maintainer :List of 6
$ _distro : chr "noble"
$ _host : chr "GitHub-Actions"
$ _registered : logi TRUE
$ _dependencies :List of 9
$ _owner : chr "jeroen"
$ _selfowned : logi TRUE
$ _usedby : int 5599
$ _updates :List of 15
$ _tags :List of 2
$ _stars : int 217
$ _contributions :List of 20
$ _userbio :List of 4
$ _downloads :List of 2
$ _mentions : int 21
$ _devurl : chr "https://github.com/jeroen/curl"
$ _searchresults : int 3424
$ _assets :List of 11
$ _homeurl : chr "https://github.com/jeroen/curl"
$ _realowner : chr "jeroen"
$ _cranurl : logi TRUE
$ _releases :List of 46
$ _exports :List of 42
$ _help :List of 19
$ _readme : chr "https://github.com/jeroen/curl/raw/HEAD/README.md"
$ _rundeps : list()
$ _sysdeps :List of 1
$ _vignettes :List of 2
$ _score : num 19.6
$ _indexed : logi TRUE
$ _nocasepkg : chr "curl"
$ _universes :List of 1
$ _binaries :List of 9
Or:
packages <- universe::universe_all_packages("jeroen")# The result is a list of packagesstr(packages[[1]], max.level =1)
List of 75
$ Package : chr "curl"
$ Type : chr "Package"
$ Title : chr "A Modern and Flexible Web Client for R"
$ Version : chr "5.3.0"
$ Authors@R : chr "c(\nperson(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"[email protected]\",\ncomment = c(ORC"| __truncated__
$ Description : chr "The curl() and curl_download() functions provide highly\nconfigurable drop-in replacements for base url() and\n"| __truncated__
$ License : chr "MIT + file LICENSE"
$ SystemRequirements: chr "libcurl: libcurl-devel (rpm) or\nlibcurl4-openssl-dev (deb). Version 7.80 or up is recommended."
$ URL : chr "https://jeroen.r-universe.dev/curl https://curl.se/libcurl/"
$ BugReports : chr "https://github.com/jeroen/curl/issues"
$ VignetteBuilder : chr "knitr"
$ RoxygenNote : chr "7.3.2.9000"
$ Encoding : chr "UTF-8"
$ Language : chr "en-US"
$ Roxygen : chr "list(markdown = TRUE)"
$ Repository : chr "https://jeroen.r-universe.dev"
$ RemoteUrl : chr "https://github.com/jeroen/curl"
$ RemoteRef : chr "HEAD"
$ RemoteSha : chr "28cf6e3589a33b618ba7134842b8efbc45e31aa5"
$ NeedsCompilation : chr "yes"
$ Packaged :List of 2
$ Author : chr "Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>),\nHadley Wickham [ctb],\nRStudio [cph]"
$ Maintainer : chr "Jeroen Ooms <[email protected]>"
$ MD5sum : chr "61990cbc51b6eb2554c8c12ac83a017f"
$ _user : chr "jeroen"
$ _type : chr "src"
$ _file : chr "curl_5.3.0.tar.gz"
$ _fileid : chr "9418b47b7ebf968afa84be0da01dc4e5cbc1f8d842d8a1de1e58d9136a154c9d"
$ _filesize : int 523775
$ _sha256 : chr "9418b47b7ebf968afa84be0da01dc4e5cbc1f8d842d8a1de1e58d9136a154c9d"
$ _created : chr "2024-10-23T14:15:00.000Z"
$ _published : chr "2024-10-23T14:25:36.391Z"
$ _buildurl : chr "https://github.com/r-universe/jeroen/actions/runs/11481752355"
$ _status : chr "success"
$ _windevel : chr "failure"
$ _linuxdevel : chr "success"
$ _wasmbinary : chr "none"
$ _macbinary : chr "success"
$ _winbinary : chr "failure"
$ _pkgdocs : chr "skipped"
$ _upstream : chr "https://github.com/jeroen/curl"
$ _commit :List of 5
$ _maintainer :List of 6
$ _distro : chr "noble"
$ _host : chr "GitHub-Actions"
$ _registered : logi TRUE
$ _dependencies :List of 9
$ _owner : chr "jeroen"
$ _selfowned : logi TRUE
$ _usedby : int 5599
$ _updates :List of 15
$ _tags :List of 2
$ _stars : int 217
$ _contributions :List of 20
$ _userbio :List of 4
$ _downloads :List of 2
$ _mentions : int 21
$ _devurl : chr "https://github.com/jeroen/curl"
$ _searchresults : int 3424
$ _assets :List of 11
$ _homeurl : chr "https://github.com/jeroen/curl"
$ _realowner : chr "jeroen"
$ _cranurl : logi TRUE
$ _releases :List of 46
$ _exports :List of 42
$ _help :List of 19
$ _readme : chr "https://github.com/jeroen/curl/raw/HEAD/README.md"
$ _rundeps : list()
$ _sysdeps :List of 1
$ _vignettes :List of 2
$ _score : num 19.6
$ _indexed : logi TRUE
$ _nocasepkg : chr "curl"
$ _universes :List of 1
$ _binaries :List of 9
6.1.4 Information on a single package in an universe
Note that searching globally only returns “indexed” packages: if a package is included in several universes, it still shows up only once in search results because of our deduplication efforts.