knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of FlickrAPI is to provide an interface to the Flickr API and allow R users to download data on public photos uploaded to Flickr.
install.packages("FlickrAPI") # remotes::install_github("koki25ando/FlickrAPI")
After installing, set up a Flickr API key and save it as a local environment variable using setFlickrAPIKey(api_key = "YOUR_API_KEY_HERE", install = TRUE)
. The Flickr API is available for non-commercial use by outside developers and is only available for commercial use under prior arrangements. Review the Flickr API documentation, API Overview, or Flickr Developer Guide for more information.
You can get photos from any individual user using the getPhotos()
function.
library(FlickrAPI) photos <- getPhotos(user_id = "grand_canyon_nps") knitr::kable(photos[1, ])
For more information about any individual image, you can use getPhotoInfo()
or the getExif()
function.
photo_info <- getPhotoInfo(photo_id = photos$id[1], output = "tags") knitr::kable(photo_info[c(1:2), ])
photo_exif <- getExif(photo_id = photos$id[10]) knitr::kable(photo_exif[1, ])
You can also search photos by tag and license.
photo_search <- getPhotoSearch( sort = "date-taken-desc", tags = c("cats", "dogs"), per_page = 50 ) knitr::kable(photo_search[1, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.