View source: R/construct_api_requests.R
construct_api_requests | R Documentation |
Main documentation: https://api.waterdata.usgs.gov/ogcapi/v0/, Swagger docs: https://api.waterdata.usgs.gov/ogcapi/v0/openapi?f=html.
construct_api_requests(
service,
properties = NA_character_,
bbox = NA,
limit = NA,
max_results = NA,
skipGeometry = FALSE,
...
)
service |
Which service available on https://api.waterdata.usgs.gov/ogcapi/v0/. |
properties |
The properties that should be included for each feature. The parameter value is a comma-separated list of property names which depend on the service being called. |
bbox |
Only features that have a geometry that intersects the bounding box are selected.The bounding box is provided as four or six numbers, depending on whether the coordinate reference system includes a vertical axis (height or depth). |
limit |
The optional limit parameter limits the number of items that are presented in the response document. Only items are counted that are on the first level of the collection in the response document. Nested objects contained within the explicitly requested items shall not be counted. |
skipGeometry |
This option can be used to skip response geometries for each feature. The returning object will be a data frame with no spatial information. |
... |
Extra parameters from the specific services. |
site <- "USGS-02238500"
pcode <- "00060"
req_dv <- construct_api_requests("daily",
monitoring_location_id = site,
parameter_code = "00060")
req_dv <- construct_api_requests("daily",
monitoring_location_id = site,
parameter_code = c("00060", "00065"))
sites <- c("USGS-01491000", "USGS-01645000")
start_date <- "2018-01-01"
end_date <- "2022-01-01"
req_dv <- construct_api_requests("daily",
monitoring_location_id = sites,
parameter_code = c("00060", "00065"),
datetime = c(start_date, end_date))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.