Instagram api - get all photos by hashtag

I'm new to this Instagram API, and I read their endpoints document, this is the endpoint I use:

/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN 

It retrieves images, but only in my account photos. I want, I will give the name of the tag, and it will display everything, not just the photos in my account, but all the photos on Instagram too.

+5
source share
4 answers

I know that it was a long time ago, but only for the record.

Since this requires public_scope permission (a permission that gives you access to all publicly available data on instagram, not just your account), your application needs to be verified and approved by Instagram. However, if you use the API for a personal project with one site, Instagram will not approve it.

Here from Instagram docs:

1: Which use case best describes your Instagram integration?

R: I want to display hashtag content and publicly available content on my website.

A: This use case is not supported. We do not approve of public_content for one-time projects, such as displaying hashtag on your site. As an alternative, you can show your own Instagram content or find a company offering this type of service (content discovery, moderation and display).

You can find more information in the permission documentation.

+8
source

By hashtag you mean tags .
It works for me. Even though I am using the python client , it should work well when you are developing your own client. Take a look:

 from instagram.client import InstagramAPI api =InstagramAPI(client_secret=settings.CLIENT_SECRET, access_token=settings.ACCESS_TOKEN) result = api.tag_recent_media(tag_name='castle') media = result[0] for m in media: print (m.images) print (m.user) print (m.tags) 
+1
source

Your client is in Sandbox mode and can only search for photo tags published by invited users. You must log in to https://www.instagram.com/developer , edit your client and click the "GO LIVE" button.

If the "GO LIVE" button is disabled , you will first get your Instagram application: go to the "Permissions" tab and send it to view. (The company name, contact email address, and privacy policy URL are required to start filing.) Once you are approved, you can click Go Live.

+1
source

You can try and it works for me.

 /v1/tags/{tag-name}/media/recent?client_id={YOUR_CLIENT_ID} 

My client ID is created before the "permission check", it works now, and now I'm trying to send permission to view on Instagram, I hope that it passes.

0
source

Source: https://habr.com/ru/post/1240397/


All Articles