How do I get the most popular tags from Instagram API? I searched the API, but didn't find a way to retrieve this data. This website gets it, but how?
Be Smart With Your Hashtags The more popular and generic a hashtag is, the harder it is to get noticed by the people who you want to interact with your posts. Choose hashtags that are relevant to your interests and industry. You can also make your own hashtags or put a spin on a trending topic.
The question is old, but for others also struggling the same problem, as Sebastien mentioned there is no such query. However I have been recently needing same functionality and came down idea that small traversal pretty much solves the problem.
Instagram doesn't respond you a list of tags starting with just one letter. Example:
This URL returns just one element, which is "a". However if you send a request containing two characters like
then you'll end up with the most popular tags starting on "aa"
Afterwards you can simply traverse your desired alphabet in O(N^2) time and by joining responses you'll end up with a list of most popular tags.
Length in case of English(Latin) alphabet would be 26^2 = 676 Though you shouldn't probably try getting any more tags as the limit is still 5,000 requests and 26^3 would go for 17576.
foreach(character in 'a'...'
{
foreach(character in 'a'...'z')
{
Send hashtag request 'aa'...'az'...'zz'
Get json and merge with previous array
}
}
Sort final array by [media_count]
Alternate approach would be to parse some huge dictionary (wikipedia dump for example) and sort out top 5000 most common prefixes and try querying them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With