% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stac.R
\name{dse_stac_search_request}
\alias{dse_stac_search_request}
\title{Create a Request for a STAC Search in the Data Space Ecosystem}
\usage{
dse_stac_search_request(collections, ids, ...)
}
\arguments{
\item{collections}{Restrict the search to the collections listed here.
If missing, the collection will be guessed from the \code{ids},
using \code{\link[=dse_stac_guess_collection]{dse_stac_guess_collection()}}.}

\item{ids}{Restrict the search to ids listed here.}

\item{...}{Arguments appended to search filter request body.}
}
\value{
Returns a \code{data.frame} with search results.
}
\description{
In order to perform a search using the STAC API, you first need to
create a request using \code{\link[=dse_stac_search_request]{dse_stac_search_request()}}. This creates
a \code{\link[httr2:request]{httr2::request()}} to which tidy verbs \code{?tidy_verbs} can be applied
(e.g., \code{\link[dplyr:select]{dplyr::select()}}, \code{\link[dplyr:filter]{dplyr::filter()}} and \code{\link[dplyr:arrange]{dplyr::arrange()}}.
Results are retrieved by calling \code{\link[dplyr:collect]{dplyr::collect()}} on the request.
}
\details{
If you prefer a graphical user interface, you can alternatively use
the \href{https://browser.stac.dataspace.copernicus.eu/}{STAC web browser}.
}
\examples{
if (interactive()) {
  library(dplyr)
  library(sf)
  
  bbox <-
    sf::st_bbox(
      c(xmin = 5.261, ymin = 52.680, xmax = 5.319, ymax = 52.715),
      crs = 4326)

  dse_stac_search_request("sentinel-2-l1c") |>
    filter(`eo:cloud_cover` < 10) |>
    collect()

  dse_stac_search_request("sentinel-1-grd") |>
    filter(`sat:orbit_state` == "ascending") |>
    arrange("id") |>
    st_intersects(bbox) |>
    collect()
}
}
\seealso{
Other stac:
\code{\link[=dse_stac_client]{dse_stac_client()}},
\code{\link[=dse_stac_collections]{dse_stac_collections()}},
\code{\link[=dse_stac_download]{dse_stac_download()}},
\code{\link[=dse_stac_get_uri]{dse_stac_get_uri()}},
\code{\link[=dse_stac_guess_collection]{dse_stac_guess_collection()}},
\code{\link[=dse_stac_queryables]{dse_stac_queryables()}}
}
\concept{stac}
