vignettes/files/apis/03-01-dynamic.R

users <- data.frame(
  uid = c(12, 13),
  username = c("kim", "john")
)

#* Lookup a user
#* @get /users/<id>
function(id) {
  subset(users, uid %in% id)
}

Try the plumber2 package in your browser

Any scripts or data that you put into this service are public.

plumber2 documentation built on Jan. 20, 2026, 5:06 p.m.