stac_search: Search a STAC API

View source: R/stac_search.R

stac_searchR Documentation

Description

Searches a STAC API endpoint for items matching the given filters and returns results as a tidy tibble. Wraps rstac::stac_search() with tidy output.

Usage

stac_search(
  url,
  collections = NULL,
  bbox = NULL,
  datetime = NULL,
  limit = 100L
)

Arguments

url

Character. Root URL of a STAC API endpoint (e.g., "https://earth-search.aws.element84.com/v1").

collections

Character vector. Collection IDs to search within.

bbox

Numeric vector of length 4: c(xmin, ymin, xmax, ymax). Only items intersecting this bounding box are returned.

datetime

Character. Date/time filter as a single datetime or range (e.g., "2024-01-01/2024-12-31"). Follows RFC 3339.

limit

Integer. Maximum number of items to return. Defaults to 100.

Value

A tibble::tibble with one row per item and columns:

id

Item identifier.

collection

Collection the item belongs to.

datetime

Acquisition datetime as a character string.

bbox

Bounding box as a numeric list column.

geometry

GeoJSON geometry as a list column.

assets

Character vector of available asset names.

Examples



stac_search(
  url = "https://earth-search.aws.element84.com/v1",
  collections = "sentinel-2-l2a",
  bbox = c(-84.5, 38.0, -84.3, 38.2),
  limit = 5
)



stacr documentation built on March 12, 2026, 5:07 p.m.