Get Flickr user photos or a user's favorite photos
getPhotos.Rd
Returns photos from the given user's photo stream. Only photos visible to the calling user will be returned.
Usage
getPhotos(user_id = NULL, img_size = "s", extras = NULL, api_key = NULL, ...)
get_photos(user_id = NULL, img_size = "s", extras = NULL, api_key = NULL, ...)
getFavePhotos(
user_id = NULL,
img_size = "s",
extras = NULL,
fave_date = NULL,
public = TRUE,
api_key = NULL,
page = NULL,
per_page = 100,
...
)
get_fave_photos(
user_id = NULL,
img_size = "s",
extras = NULL,
fave_date = NULL,
public = TRUE,
api_key = NULL,
page = NULL,
per_page = 100,
...
)
Arguments
- user_id
The NSID of the user whose photos to return. A value of "me" return the calling user's photos.
- img_size
A character string with the abbreviation for one or more image sizes ("sq", "t", "s", "q", "m", "n", "z", "c", "l", or "o"). If a single img_size is provided the url, width, and height columns are renamed (e.g. img_url instead of url_sq) and an img_asp column is added to the results; defaults to
NULL
.- extras
A vector of extra information to fetch for each returned record. Currently supported fields are: c("description", "license", "date_upload", "date_taken", "owner_name", "icon_server", "original_format", "last_update", "geo", "tags", "machine_tags", "o_dims", "views", "media", "path_alias", "url_sq", "url_t", "url_s", "url_q", "url_m", "url_n", "url_z", "url_c", "url_l", "url_o")
- api_key
Flickr API key. If api_key is
NULL
, the function usesgetFlickrAPIKey()
to use the environment variable "FLICKR_API_KEY" as the key.- ...
Arguments passed on to
getPhotoSearch
tags
A vector of tags to search for.
license_id
The license id for photos. For possible values, see the Flickr API method flickr.photos.licenses.getInfo or see details for more information. If license_id is provided, "license" is added to extras.
sort
Order to sort returned photos. The possible values are: "date-posted-asc", "date-posted-desc", "date-taken-asc", "date-taken-desc", "interestingness-desc", "interestingness-asc", and "relevance" The trailing "-asc" or "-desc" indicator for sort direction is optional when using the desc parameter.
desc
If
TRUE
, sort in descending order by the selected sort variable; defaults toFALSE
.bbox
A object of class
bbox
or a numeric vector with values for xmin, ymin, xmax and ymax representing the bottom-left corner of the box and the top-right corner.date
Date taken in any format supported by
as.POSIXlt()
. If date is a length 1 vector, it is treated as a minimum date taken with the maximum set one day later. If date has a length greater than 1, the minimum and maximum date from the vector are used. If date is provided, "date_taken" is added to extras.upload_date
Date uploaded in any format supported by
as.POSIXlt()
. If upload_date is a length 1 vector, it is treated as a minimum date uploaded with the maximum set one day later. If date has a length greater than 1, the minimum and maximum date from the vector are used. If date is provided, "date_upload" is added to extras.
- fave_date
Date favorited in any format supported by
as.POSIXlt()
. If fave_date is a length 1 vector, it is treated as a minimum date uploaded with the maximum set one day later. If fave_date has a length greater than 1, the minimum and maximum date from the vector are used. If date is provided, "date_upload" is added to extras.- public
If
TRUE
, get public favorites (no authentication needed). IfFALSE
, get all favorites (requires authentication for access).- page
Number specifying which search results page to return. Default is page 1 of results returned.
- per_page
Number specifying how many results per page to return. Default 100 results per page. Maximum of 250 if
bbox
provided or 500 otherwise.
Details
For getFavePhotos()
the provided user_id may need to be the NSID code or
the user name rather than the typical user id due to some inconsistencies in
the Flickr API.
See also
Flickr API documentation: flickr.favorites.getPublicList or flickr.favorites.getList
Examples
if (FALSE) {
getPhotos(
api_key = get_flickr_api_key(),
user_id = "141696738@N08"
)
}