Is it possible to get related tags on Instagram via the API?
You can get a tags data by doing a GET request on
https://api.instagram.com/v1/tags/{tag-name}?access_token=ACCESS-TOKEN
But is it possible to get related tags? so if I searched for webdesign it might return websitedesign etc
Related
I'm using this url: https://www.instagram.com/explore/tags/meugatonovet/?__a=1, to get hashtag data. With this parameter it shows a json, but returns only 39 posts/pots of 7,000 thousand.
Is there a tool, some parameter or something else that can make it return more data?
Using ?__a=1 parameter is a neat trick to get JSON data for any Instagram page, but it's not an official API; Instagram can block your IP address any time and the endpoint is not guaranteed to remain stable.
The official way to look up media via hashtag is with Graph API Hashtag Search.
See getting started for initial steps. You need a business account ID for your Instagram profile which is required parameter for hashtag search. Then you can do these steps:
Find the ID of the hashtag you are looking for, for example:
GET https://graph.facebook.com/v13.0/ig_hashtag_search?user_id=<business account ID>&q=meugatonovet&access_token=<user access token>
This will return a JSON of the hashtag:
{
"data": [
{
"id": "17878113037414936"
}
]
}
Use that ID in other requests, for example /recent_media:
GET https://graph.facebook.com/v13.0/17878113037414936/recent_media?user_id=<business account ID>&fields=id,media_type,comments_count,like_count,media_url&access_token=<user access token>
The response will also provide the pagination cursor which lets you read all the data within API limitations.
Other less official options are web scraping or using Instagram's private API (there are actively maintained libraries for that, like instagram-private-api), but mind that this might get you banned and it breaks Instagram's ToS. It's probably fine for a personal project, but not so fine for a commercial use.
This endpoint is not working anymore:
https://www.instagram.com/explore/tags/username/?__a=1
However, a possible solution is adding __d=dis to your payload:
https://www.instagram.com/explore/tags/username/?__a=1&__d=dis
Please, take into account that this is an unofficial method, and you can get banned as #jnv advised.
Best regards
I've been trying to get similar hashtags using __a==1 parameter but
https://www.instagram.com/explore/tags/home/?__a=1
only returns the data for just one tag.
Is there any way to get the similar tags we get suggested in Instagram mobile search function?
I need to get media from connected instagram profile by hashtag. For most part, I was successful, however I stumbled upon a few limitation I cannot find workaround for.
When I fetch media on IG user, I can send username as a field and get it back. However, I cannot get username on IG hashtag, it is not listed as field in documentation, and throws error if I send one.
I don't want to get back albums on IG hashtag, just image and video, but I can't seem to find a way to filter by type
What is interesting, I found an example of site that displays username when filtering by hashtag, but the only way I could think of achiving this is to send request for media details for each media I receive. Needless to say, I want to avoid it.
Has anyone had a similar problem and solved it?
I am trying to fetch the instagram feeds to my site using tag name.
https://api.instagram.com/v1/tags/{tag-name}?access_token=ACCESS-TOKEN
above is the api which I am using to get the feeds.
Now the feeds are displaying from all the users who use the tag. I need to restrict the feeds for the particular user who use the tag name.
Anyone come across this?
Thanks,
The current version of the Instagram Api does not have an endpoint that will allow you to get media by tag-name AND user-id. Your best bet is to use 1 of the following endpoints, and then loop through the results and filter out the media that matches the 2nd condition.
Search for posts by given hashtag's name using GET /tags/{tag-name}/media/recent API endpoint request and then filter the response list of media to match the user-id for the particular user in question.
or
Search for posts by the particular user using GET /users/{user-id}/media/recent API endpoint request and then manually check every post if its tags array contains the specific hashtag you are looking for.
I recommend you go with option 2 as that will be faster, since an individual user feed is a much smaller data set than media from 1000s of Instagram users tagged with a hashtag.
Im trying to display in my website photos froma photoset I have in Flickr. In the documentation says:
You can construct the source URL to a photo once you know its ID, server ID, farm ID and secret, as returned by many API methods.
But I only know how to get the Photo ID. How can I get the rest of the information?
The simplest API is flickr.photos.search, and you can find the documents from
http://www.flickr.com/services/api/flickr.photos.search.html
And an example output could be found there.
when you get the ouput, a photo could be accessed by
http://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}.jpg