Retrieve metadata

Utility functions for feature service metadata.

Usage

fetch_layer_metadata(url, token = NULL, call = rlang::caller_env())

Arguments

url

the url of the item.

token

an httr2_token from one of the provided auth_ functions

call

default rlang::caller_env(). The calling environment passed to detect_errors().

Value

returns a list object

Details

  • fetch_layer_metadata() given a request, fetches the metadata by setting the query parameter f=json

Examples

# url is broken into parts to fit within 100 characters to avoid CRAN notes
url_parts <- c(
  "https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services",
  "/USA_Counties_Generalized_Boundaries/FeatureServer/0"
)

furl <- paste0(url_parts, collapse = "")
meta <- fetch_layer_metadata(furl)
head(names(meta))
#> [1] "currentVersion" "id"             "name"           "type"          
#> [5] "serviceItemId"  "cacheMaxAge"   

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close