Skip to contents

Search across all datasets and resources in Peru's open data portal. Returns results organized by datasets and their associated resources.

Usage

po_search(
  query = NULL,
  tags = NULL,
  type = c("all", "datasets", "resources"),
  formats = NULL,
  organizations = NULL,
  search_tags_only = FALSE,
  use_cache = TRUE,
  verbose = FALSE
)

Arguments

query

Character string to search for (searches titles, descriptions, organizations, tags)

tags

Character vector of tags to search for in tag fields only

type

What to search: "all" (default), "datasets", or "resources"

formats

Character vector of resource formats to filter (e.g., c("CSV", "XLSX"))

organizations

Character vector of organizations to filter

search_tags_only

Logical. If TRUE and query provided, search only in tag fields (default FALSE)

use_cache

Logical. Use cached catalog (default TRUE)

verbose

Logical. Show search progress (default FALSE)

Value

A list containing:

datasets

Tibble of matching datasets

resources

Tibble of resources from matching datasets

summary

Search result statistics

Examples

if (FALSE) { # \dontrun{
# Search everything related to COVID
covid_data <- po_search("covid")

# Find all CSV files about dengue
dengue_csv <- po_search("dengue", formats = "CSV")

# Get all resources from MINSA
minsa <- po_search(organizations = "MINSA", type = "resources")

# Search by specific tags
health_data <- po_search(tags = c("salud", "medicina"))

# Search only in tag fields (not titles/descriptions)
tag_only <- po_search("covid", search_tags_only = TRUE)

# Just search for resources directly
csv_files <- po_search(type = "resources", formats = "CSV")
} # }