flickr.restquery: Call the Flickr REST API

Description Usage Arguments Value Examples

View source: R/flickrrestquery.R

Description

Calls the https://www.flickr.com/services/api/, returning the parsed JSON as a list. This is a low-level function designed to serve as the base to all flickr method calls. Results are cached and the cache is used instead of querying the REST API to prevent unnecessary calls (useful for repetetive scripts). To pass a list of key/value pairs, use do.call(flickr.restquery, key_value_list)

Usage

1
2
flickr.restquery(..., rest_api = "https://api.flickr.com/services/rest/",
  .usecache = TRUE)

Arguments

...

Arguments are treated as key/value pairs to be passed to the URL.

rest_api

The base URL for the REST API.

.usecache

TRUE if the cache should be used, use FALSE to force a call to the REST API.

Value

A list of the result. This list is guaranteed to have a stat and result element describing the result.

Examples

1
2
3
4
5
6
library(flickRgeotag)
flickr.restquery(method="flickr.test.echo", name="value", api_key="610ccba3a846af469e1894da33514ea1")

dta <- flickr.restquery(method="flickr.photos.search", api_key="2adee16e727679964eda05463d41fa74", bbox="-65,44.5,-64.5,45")
df <- data.frame(t(sapply(dta$photos$photo, function(item) {item})))
head(df)

remi-daigle/flickRgeotag documentation built on July 14, 2020, 8:37 a.m.