Skip to contents

Search for content on the Connect server

Usage

search_content(
  client,
  q = NULL,
  include = "owner,vanity_url",
  page_size = 500,
  limit = Inf,
  ...
)

Arguments

client

A Connect object

q

The search query, using the syntax described in the Connect documentation on content search terms

include

Comma-separated character string of values indicating additional details to include in the response. Values can be owner and vanity_url; both are included by default.

page_size

The number of items to fetch per page. Maximum is 500.

limit

Maximum number of items to return overall. Defaults to Inf (all items).

...

Additional query parameters passed to the API for future expansion. Note: If you pass page_number here, it will affect the starting page for pagination, but all subsequent pages will still be fetched. This is usually not what you want.

Value

A list of Content objects, of class "connect_content_list"

Details

Please see https://docs.posit.co/connect/api/#get-/v1/search/content for more information.

Examples

if (FALSE) { # \dontrun{
library(connectapi)
client <- connect()

my_content <- search_content(client, q = "owner:@me")

shiny_content <- purrr::keep(my_content, function(x) {
  x$content$app_mode == "rmd-shiny"
})

purrr::map(shiny_content, lock_content)
} # }