% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stac.R
\name{dse_stac_download}
\alias{dse_stac_download}
\title{Download Asset From STAC Catalogue}
\usage{
dse_stac_download(
  asset_id,
  asset,
  collection = dse_stac_guess_collection,
  destination,
  ...,
  s3_key = dse_s3_get_key(),
  s3_secret = dse_s3_get_secret(),
  token = dse_public_access_token()
)
}
\arguments{
\item{asset_id}{STAC id, used for locating the asset download details.}

\item{asset}{Name of the asset to download}

\item{collection}{The identifier for a collection. The default argument
is the \code{\link[=dse_stac_guess_collection]{dse_stac_guess_collection()}} function which tries to guess the
collection id from the \code{asset_id}. A more rigid approach is to provide
the collection id as a \code{character} string.}

\item{destination}{Directory path where to store the downloaded file.}

\item{...}{Ignored}

\item{s3_key, s3_secret}{The s3 key and secret registered under your Data Space
Ecosystem account}

\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 the path to the downloaded file.
}
\description{
Use \code{\link[=dse_stac_search_request]{dse_stac_search_request()}} to identify assets that can be downloaded.
Use \code{\link[=dse_stac_download]{dse_stac_download()}} to download an asset by its STAC id and asset name.
}
\examples{
if (interactive() && (dse_has_s3_secret() || dse_has_client_info())) {
  dse_stac_download(
    asset_id = "S2A_MSIL1C_20260109T132741_N0511_R024_T39XVL_20260109T142148",
    asset = "B01",
    destination = tempdir()
  )
}
}
\seealso{
Other stac:
\code{\link[=dse_stac_client]{dse_stac_client()}},
\code{\link[=dse_stac_collections]{dse_stac_collections()}},
\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()}},
\code{\link[=dse_stac_search_request]{dse_stac_search_request()}}
}
\concept{stac}
