Skip to contents

Use beekeeper to create and maintain R packages that wrap APIs. The generated packages follow best practices, including documentation and testing.

This package focuses on APIs that follow the OpenAPI Specification (OAS). Currently versions 3.0 and 3.1 are supported, with support for swagger 2.0 to come. The APIs must have an API document in yaml format. The package skeletons generated by beekeeper implement best practices to streamline package development.

The Plan

This project has been accepted by the R Consortium 2023 ISC Grant Program!

This is a rough outline of the planned development milestones of this package, working toward a stable version 1.0.0. Most of the outline was included in the grant proposal.

      • UPDATE: This functionality is in a separate package, {anyapi}.
      • Update: Also, this likely could go unsaid, but, if the API description is incorrect, the functions will not work as expected. Hopefully their error messages will be helpful for debugging, though!
      • UPDATE: The development version of {httr2} has functionality to help with this quite a lot, thankfully! I’m skipping this milestone while that functionality stabilizes (this was previously 0.3.0).
  • 0.5.0: More robust scaffolding.
    • Add parameter documentation.
    • Also add parameter type checking.
    • Potential challenges: By this point I’ll need an OAS definition document to use for testing that includes all of the possible parameter types. I’ll likely need to generate a fake API specification that goes beyond a typical individual example.
  • 0.6.0: Expected results.
    • Add response (return value) documentation.
    • Use expected responses to generate better test scaffolds.
    • Potential challenges: Testing the generation of tests might present unique challenges. I’ll need to look into how testthat tests itself.
  • 0.7.0: Error messaging.
    • Add more robust error messaging for non-standard responses.
    • Potential challenges: Mocking cases where things fail can be tricky. Ideally this step will involve pushing the package to a stable 1.0.0, but that will require enough usage to feel confident that the core function definitions are stable.


Install the development version of beekeeper from GitHub:

# install.packages("pak")


Use use_beekeeper() to generate a _beekeeper.yml file, and then generate_pkg() to generate code based on that configuration.

Read vignette("beekeeper") for more details.

Why “beekeeper”?

A beekeeper is someone who tends to bees, and {beekeeper} is a package that helps you tend to APIs. “Apis” is Latin for “bee”, and is the genus name for honey bees.

In addition to the pun, I hope to eventually include a “hive” of hex logos on this site, with each hex representing an API package that has been “tended” by {beekeeper}.

Code of Conduct

Please note that the beekeeper project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.