Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instagram api - get all photos by hashtag

Tags:

api

instagram

I am new to this Instagram API, and I read their doc about endpoints, this is the endpoint that I am using:

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

It is fetching the images, but, only on my accounts photos. I want is, I will give an tag-name, and it wll display all, not just the photos on my account, but all the photos in Instagram too.

like image 634
remo lalata Avatar asked Jan 12 '16 03:01

remo lalata


People also ask

How do you get all hashtags on Instagram with API?

The Hashtag Search API consists of the following nodes and edges: GET /ig_hashtag_search — to get a specific hashtag's node ID. GET /{ig-hashtag-id} — to get data about a hashtag. GET /{ig-hashtag-id}/top_media — to get the most popular photos and videos that have a specific hashtag.

How do you see all posts in a hashtag on Instagram?

Hashtag pages have an Instagram Story icon in the top left corner. Click on it and you'll see a collection of Stories posts tagged with the hashtag from people with public profiles.

Does Instagram API still work?

In 2018, Instagram shut down its public API. Meaning, third-party apps can no longer access the API from Instagram without permission. Third-party apps now need to be approved by Instagram before they can access the API.

What information can I get from Instagram API?

The API can be used to get and publish their media, manage and reply to comments on their media, identify media where they have been @mentioned by other Instagram users, find hashtagged media, and get basic metadata and metrics about other Instagram Businesses and Creators.


2 Answers

I know has been a long time, but just for the record.

Since you need the public_scope permission for this (the permission that gives you access to all public data on instagram, and not only your account) you need your app to be reviewed and approved by Instagram. However, if you're using the API for a one-site personal project, Instagram will not approve it.

Here's from Instagram's docs:

1: Which use case best describes your Instagram integration?

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

A: This use case is not supported. We do not approve the public_content permission for one-off projects such as displaying hashtag based content on your website. As alternative solution, you can show your own Instagram content, or find a company that offers this type of service (content discover, moderation, and display).

You can find more information in the Permission Review documentation.

like image 105
Matías Navarro Carter Avatar answered Sep 19 '22 11:09

Matías Navarro Carter


You can try it and it is working for me.

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

My client id is created before "permission review", it is working now and I am trying to submit permission review to Instagram now, hope it will pass.

like image 26
Brad Chou Avatar answered Sep 16 '22 11:09

Brad Chou