% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sentinelhub.R
\name{dse_sh_search_request}
\alias{dse_sh_search_request}
\title{Create a Request for the SentinelHub Catalogue}
\usage{
dse_sh_search_request(
  collection,
  bbox,
  datetime,
  ...,
  token = dse_access_token()
)
}
\arguments{
\item{collection}{A collection for which to list the features.
See \code{\link[=dse_sh_collections]{dse_sh_collections()}} for a list of Sentinel Hub collections.}

\item{bbox}{An object that can be converted into a \code{bbox} class
object (see \code{\link[sf:st_bbox]{sf::st_bbox()}}).}

\item{datetime}{A date-time object, or a vector of two date time
objects (in case of a range). Or an object that can be converted into
a datetime object.}

\item{...}{Ignored}

\item{token}{For authentication, many of the Data Space Ecosystem uses
an access token. Either provide your access token, or obtain one automatically
with \code{\link[=dse_access_token]{dse_access_token()}} (default). Without a valid token you will likely get
an "access denied" error.}
}
\value{
Returns a \code{sentinel_request} class object, which inherits
from the \code{httr2::request} class. Call \code{\link[dplyr:collect]{dplyr::collect()}} on it to
retrieve results.
}
\description{
In order to perform a search using the STAC API, you first need to
create a request using \code{\link[=dse_sh_search_request]{dse_sh_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()}} and \code{\link[dplyr:filter]{dplyr::filter()}}.
Results are retrieved by calling \code{\link[dplyr:collect]{dplyr::collect()}} on the request.
}
\examples{
if (interactive() && dse_has_client_info()) {
  library(dplyr)
  
  dse_sh_search_request(
    collection = "sentinel-2-l2a",
    bbox       = c(5.261, 52.680, 5.319, 52.715),
    datetime   = c("2025-01-01 UTC", "2025-01-31 UTC")
  ) |>
    filter(`eo:cloud_cover` <= 10) |>
    collect()
}
}
\references{
\itemize{
\item \url{https://docs.sentinel-hub.com/api/latest/api/catalog/}
}
}
\seealso{
Other sentinelhub:
\code{\link[=dse_sh_collections]{dse_sh_collections()}},
\code{\link[=dse_sh_custom_scripts]{dse_sh_custom_scripts()}},
\code{\link[=dse_sh_features]{dse_sh_features()}},
\code{\link[=dse_sh_get_custom_script]{dse_sh_get_custom_script()}},
\code{\link[=dse_sh_prepare_input]{dse_sh_prepare_input()}},
\code{\link[=dse_sh_process]{dse_sh_process()}},
\code{\link[=dse_sh_queryables]{dse_sh_queryables()}},
\code{\link[=dse_sh_use_requests_builder]{dse_sh_use_requests_builder()}}
}
\concept{sentinelhub}
