"Flickr" (Service Connection)
"Flickr" (Service Connection)
Obsolete
Connecting & Authenticating
ServiceConnect["Flickr"] creates a connection to the Flickr API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
Requests
ServiceExecute["Flickr","request",params] sends a request to the Flickr API, using parameters params. The following give possible requests.
User Information
"UserData" — profile information for the specified user
| "User" | authenticated user | user ID, name, or email |
Search Images
"ImageSearch" — search photos by user, keyword, description, date range, or location
| "User" | None | user ID, name, or email | |
| "Keywords" | None | general search keywords | |
| "Description" | None | keywords to search for in photo title, description, or tags | |
| "DateTaken" | None | date or date range photos were taken | |
| "DateUploaded" | None | date or date range photos were uploaded | |
| "Location" | None | location of photos | |
| "Elements" | "Data" | data elements to return | |
| "Format" | "Dataset" | output format | |
| "ImageSize" | "Medium" | image size | |
| MaxItems | 30 | number of results to return | |
| "StartIndex" | 1 | index of first search result to return | |
| "SortBy" | None | sorting order parameter |
Import Images
"ImportImage" — import a specific image
| "Keys" | (required) | photo ID, farm, server, and secret keys, all provided by "Keys" field in "ImageSearch" request | |
| "ImageSize" | "Thumbnail" | image size |
User Image Collections
"UserGalleries" — list of photo galleries for a specific user
"UserAlbums" — list of photo albums for a specific user
| "User" | authenticated user | user ID, name, or email | |
| MaxItems | 100 | number of results to return | |
| "ShowPrimaryPhoto" | False | whether to return a representative photo for each gallery |
Photo Gallery Data
"GalleryImages" — data about a specific photo gallery
| "GalleryID" | (required) | gallery ID | |
| "Elements" | "Data" | data elements to return | |
| "Format" | "Dataset" | output format of data elements | |
| "ImageSize" | "Medium" | image size |
Photo Album Data
"AlbumImages" — data about a specific photo album
| "AlbumID" | (required) | album ID | |
| "Elements" | "Data" | data elements to return | |
| "Format" | "Dataset" | output format of data elements | |
| "ImageSize" | "Medium" | image size | |
| MaxItems | 100 | number of elements to return |
Parameter Details
| username | simple username | |
| {"UserID",id} | where id stands for the API user's ID | |
| {"UserName",username} | equivalent to passing the username | |
| {"UserEmail",address} | where address stands for the email associated to the user's account |
| "Images" | return a list of images | |
| "Data" | return a dataset with a limited set of fields | |
| "FullData" | return a dataset with all available fields | |
| "ImageLinks" | return a list of image hyperlinks | |
| "LinkedThumbnails" | return a list of hyperlinked thumbnails |
| "Small" | 320×240 | |
| "Medium" | 800×600 | |
| "Large" | 1024×768 | |
| "Thumbnail" | 100×75 | |
| "Original" | original image size |
Examples
Basic Examples (7)
flickr = ServiceConnect["Flickr"]results = flickr["ImageSearch", {"Keywords" -> {"sunset", "mountain"}, "Elements" -> "Data", MaxItems -> 5}]Links to original photos are provided in MetaInformation:
Options[results[1, "Thumbnail"]]ServiceExecute["Flickr", "ImageSearch", {"Location" -> Entity["City", {"Miami", "Florida", "UnitedStates"}], "Description" -> "palm tree", "Elements" -> "LinkedThumbnails", MaxItems -> 3}]results = ServiceExecute["Flickr", "ImageSearch", {"Location" -> GeoDisk[{40.0971, -88.2457}, ["1000 meters"]], "Elements" -> {"Data"}, MaxItems -> 10}]ServiceExecute["Flickr", "ImageSearch", {"Location" -> GeoBoundingBox[{GeoPosition[{48.847975, 2.290173}], GeoPosition[{48.877619, 2.300902}]}], "Elements" -> {"LinkedThumbnails"}, MaxItems -> 5}]Search photos by location or keyword, taken during a specific date range:
photos = ServiceExecute["Flickr", "ImageSearch", {"Location" -> ["las vegas"], "Keywords" -> {"casino"}, "DateTaken" -> {["january 1st"], Today}, "Elements" -> {"FullData"}, "ImageSize" -> "Small", MaxItems -> 5}]ServiceExecute["Flickr", "ImageSearch", {"User" -> "missgeok", MaxItems -> 3, "Elements" -> {"LinkedThumbnails"}}]ServiceExecute["Flickr", "ImageSearch", {"User" -> {"UserID", "55897421@N08"}, MaxItems -> 3, "Elements" -> {"LinkedThumbnails"}}]results = ServiceExecute["Flickr", "ImageSearch", {"Keywords" -> {"tulip"}, "Elements" -> {"Data"}, MaxItems -> 16}];ImageCollage[ServiceExecute["Flickr", "ImportImage", {"Keys" -> #, "ImageSize" -> "Medium"}]& /@ Normal@results[All, "Keys"]]Show information about a user's photo albums or galleries:
album = ServiceExecute["Flickr", "UserAlbums", {"User" -> "Dûredhel", "ShowPrimaryPhoto" -> True}];album[[ ;; 5, "PrimaryPhoto"]]//NormalShow information about a specific photo gallery or album:
ServiceExecute["Flickr", "GalleryImages", {"GalleryID" -> "5704-72157621866331337", "Elements" -> "LinkedThumbnails"}]ServiceExecute["Flickr", "AlbumImages", {"AlbumID" -> "72157644874295829", "Elements" -> "Images", "ImageSize" -> "Small", MaxItems -> 5}]