Flickr API get image based on location - flickr

Is it possible through flickr api or some other service obtain CC-images taken at the location the user is situated?
Like getting the lat and long from the browser and sending it to flickr and then fetching an image taken there? Similar to how the yahoo app on iOS does.

Check out the flickr API documentation for flickr.photos.search.
There are optional lat, lon, radius and geo-context parameters.

Here is an example url showing the format for an endpoint to search for photos at a specific location:
https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=e693af3d1f05789dfaad53030d8ba9e2&lat=37.7994&lon=122.3950&format=rest&api_sig=b5935d841e55cb4281b9c84701422ae8
I tested the endpoint in postman and in my browser, and it returns an xml including photos tagged to the lat and lon I specified.
The example was created thanks to some documentation here: https://www.flickr.com/services/api/flickr.photos.geo.photosForLocation.html
And the ever handy Flickr api explorer tool: https://www.flickr.com/services/api/explore/flickr.photos.search

Related

Adding image from google drive into google slideshow with API

I'm trying to add an image that I've uploaded to Drive via the Drive API into a slide show I've created using the same API.
when Running the fairly standard:
response = (self
._slides_service
.presentations()
.batchUpdate(presentationId=slide_deck_id, body=body)
.execute()
)
I get:
googleapiclient.errors.HttpError: <HttpError 400 when requesting {url} returned "Invalid requests[0].createImage: The provided image is in an unsupported format.">
I'm generating the service in the same way as suggested in the documentation here: https://developers.google.com/slides/quickstart/python
My scope is:
https://www.googleapis.com/auth/presentations
If I run the command with a random png from the internet then it inserts the image fine. I've tried the url provided by webContentLink or WebViewLink values from the response from uploading the images. Neither are valid.
What URL will work to do this?
I'm aware there are other similar questions on stack overflow but all of them are not related to doing this in python or if they are, there solutions don't work.
EDIT:
body is:
{'requests': [{'createImage': {'url': url, 'elementProperties': {'pageObjectId': page_id}}}]}
had to generalise the url and page id because GDPR is a pain.

Instagram oEmbed - URL signature mismatch for thumbnail_url

Is there any way how to correctly fetch the thumbnail image for video from Instagram oEmbed?
The typical thumbnail_url in oEmbed response now is https://scontent-cdg2-1.cdninstagram.com/vp/5c0c62bb1aec72c31a9e72680b9d839b/5C37201B/t51.2885-15/sh0.08/e35/p640x640/47693743_354556005338968_7959923928510913600_n.jpg that produces "URL signature mismatch" instead of the image.
What you need to do, is to use the shortlink provided by instagram, you can find this or either via the embed function in the UI or via the API, In the API shows as 'link', then add '/media' at the end, this will redirect to the resource without need to sign the calls.
Hope helps

Instagram Hashtag Search API returns error message "user_id is required" although I have provided it

I am trying to get data about media from my IG Business account with a specific hashtag.
I used Graph API Explorer and tried with
/{hashtag_id}?user_id={instagram_business_id}&fields=recent_media
but I got an error "(#100) The parameter user_id is required."
Does anybody know what may be the problem and how to solve it?
The API URL is incorrect, your URL should look like this:
/{hashtag_id}/recent_media?user_id={instagram_business_id}&fields=id,caption,media_url...

How to retrieve all images from multiple photo post on Instagram

Recently Instagram announced support for multiple photos post.
I tried with endpoint, GET /media/media-id, but response has information about only one image.
Anyone is able to retrieve all images from single multiple photo post using their API?
Thanks.
Not available in official API yet, but you can use the "Instagram Photo Page URL" and add ?__a=1, this will give you JSON with all the multi-images in it.
For example:
https://www.instagram.com/p/BQ00n_BB7Dm/?__a=1
You will get JSON response with media.edge_sidecar_to_children.edges[] will have all media urls and info
Instagram API now supports the "multi photo" posts.
If a post is of type "multi photo", in the API the "type" property will now be with the value "carousel" and the "mediaData" property will contain "carousel_media" property with an array of the images (posts).

Flickr api - call photo sets

I have API key and API secret and i have downloaded the recent library 3.1.
When i use the example mentioned, i get public photos. And the library i am using included this file phpFlickr.php which has all methods.
I am now trying to access the photo sets api, which is not returning anything. And the document says there is no other authentication that is required. please check the code below
require_once("phpFlickr.php");
$f = new phpFlickr("56cc01317fdce40c31c8f66498746c4d");
$sets = $f->photosets_getList();
#sandy : If you want to show flickr slider gallery in your website then you can use pictobrowser its best way to display flickr and Piccasa albums on website.
Using PictoBrowser one can easily embed Flickr and Picasa photostreams in anywebsite. All you need is follow few simple steps given here.
- visit http://pictobrowser.com/
- Click PictoBuilder at the top left corner of the page.
- Enter your Flickr/Picasa username.
- Choose images/ albums.
- Set Tag or Groups.
- It outputs some HTML code
- Copy that HTML code and paste it in your website or blog.

Resources