silend
silend

Reputation: 43

instagram likes per time

need help from anybody who had experience with instagram api I want to fetch data about likes per time for user ( 01.01.16 earned 100 likes, 02.01.16 earned 150 like, etc ), but found nothing about time metrics in user/media or likes endpoints in api ( they have this metric for comments, but not for likes). Also have no ideas how to scrape this information. Probably it is possible to set up real time subscription for likes, but in such case it would be impossible to show information for user before he subscripted. I believe that exist the way to do it, because i have seen such charts on different instagram analytics web apps, so would be happy if anyone could tell at least idea how to get this

Thanks in advance, Igor

Upvotes: 1

Views: 891

Answers (1)

krisrak
krisrak

Reputation: 12952

There is no timestamp for likes via API, you only get the latest 120 liked users via API:

https://api.instagram.com/v1/media/{media-id}/likes?access_token=ACCESS-TOKEN

To collect the data you are looking for, you have to call the media API every day and calculate the like count:

https://api.instagram.com/v1/media/{media-id}?access_token=ACCESS-TOKEN

get the data.likes.count at the end of every day. Run a cron job that makes a API call at 12:00 AM every day and collect the data.likes.count data and store/calculate.

Upvotes: 1

Related Questions