how to scrape likes on instagram

  • Last Update :
  • Techknowledgy :

To extract that kind of information, you'll need to use our Instagram Scraper. The scraper is free to use and will let you download all of this public data from Instagram:,Our Instagram Scraper is one of many actors available in Apify Store. Apify actors are cloud programs that accept input, perform their job, and generate some output. They can be run manually in the app, using the API or scheduler.,Now you can use our ultra-fast and easy dedicated scrapers if you want to scrape specific Instagram data. These Instagram scrapers have fewer settings to change and they'll give you fast, clean results ⬇️,Although it would be possible to automatically log in to Instagram in order to access this data, this approach is risky since it can lead to the banning of your account by Instagram. Sure, you could create a fake Instagram account and use that instead, but that’s beyond the scope of this article.

There is even a nice internal API endpoint that can be used to get the results in JSON format:

https: //

Suggestion : 2

Given the hypothesis that you already collected some posts url, you could easily get the likes by doing the following:

posts = ['BxuiTcLnTWO', 'BxkKDnCngp0', 'BxiNq5-nxOj', 'Bxhr01unQ11']

for post in posts:
   post_url = '{}/'.format(post)
response = requests.get(post_url.format(post))
soup = BeautifulSoup(response.content)
sharedData = soup.find('script', text = re.compile('"mainEntityofPage"')).text
likes = json.loads(sharedData.strip())['interactionStatistic']['userInteractionCount']
print(post_url, '-', likes, 'likes')

pip install using pip install insta-scrape and then

from instascrape
import Post
google_post = Post("")
print(f "{google_post.likes} likes") >>>

Suggestion : 3

Instagram scraping means automatically gathering publicly available data from Instagram users. The process may include scraping tools, Instagram scraping services or manually extracting the data. You can scrape data like as email addresses, phone numbers, images, bio, likes, comments, etc. ,While Instagram forbids any kind of crawling, scraping, or caching content from Instagram it is not regulated by law. Meaning, if you scrape data from Instagram you may get your account banned, but there are no legal repercussions.,To scrape Instagram with Python you can use a tool like Instagramy. This tool is specifically created for Instagram and has data analyzing ability through Pandas. ,You can use Python (GitHub) to build your own Instagram scraper or buy Instagram users' data from Influencers Club.

pip install instagramy
from instagramy
import Instagram

# Connecting the profile
user = Instagram("geeks_for_geeks")

# printing the basic details like
# followers, following, bio

return list of dicts
posts = user.get_posts_details()

print('\n\nLikes', 'Comments')
for post in posts:
   likes = post["likes"]
comments = post["comment"]
print(likes, comments)
from instagramy
import Instalysis

# Instagram user_id of ipl teams
teams = ["chennaiipl", "mumbaiindians",
   "royalchallengersbangalore", "kkriders",
   "delhicapitals", "sunrisershyd",

data = Instalysis(teams)

return the dataframe
data_frame = data.analyis()
def get_likes_list(username):
result = api.LastJson
username_id = result['user']['pk'] # Get user ID
user_posts = api.getUserFeed(username_id) # Get user feed
result = api.LastJson
media_id = result['items'][0]['id'] # Get most recent post
api.getMediaLikers(media_id) # Get users who liked
users = api.LastJson['users']
for user in users: # Push users to list
   'pk': user['pk'],
   'username': user['username']

Suggestion : 4

Two Factor Authentication is also supported through cli interface, simply use 'True' for second argument of login() function,It is not easy to get Applications approved for Instagram's API therefore I created this tool inspired by instagram-php-scraper. The goal of this project is to become as minimalistic as possible while still having all the needed functionality so that its easy to add code to it!,If different proxies and accounts are used for all requests and the circle doesn't repeat too fast these limits don't apply ;),If you use authentication, the program will cache the user session by default so one doesn't need to create session every time. If one want to disable the user session cache, assign True to Instagram.login() method

pip install igramscraper
pip install - r requirements.txt
from igramscraper.instagram
import Instagram

instagram = Instagram()

# authentication supported
instagram.with_credentials('username', 'password')

#Getting an account by id
account = instagram.get_account_by_id(3)

# Available fields
print('Account info:')
print('Id: ', account.identifier)
print('Username: ', account.username)
print('Full name: ', account.full_name)
print('Biography: ', account.biography)
print('Profile pic url: ', account.get_profile_picture_url())
print('External Url: ', account.external_url)
print('Number of published posts: ', account.media_count)
print('Number of followers: ', account.followed_by_count)
print('Number of follows: ', account.follows_count)
print('Is private: ', account.is_private)
print('Is verified: ', account.is_verified)

# or simply
for printing use
from igramscraper.instagram
import Instagram

proxies = {
   'http': '',
   'https': '',

instagram = Instagram()

account = instagram.get_account('kevin')

Suggestion : 5

Last Updated : 17 May, 2022

The python package Instagramy is used to scrape Instagram quick and easily. This package is installed by running the following command. Based on the network connection it scrapes the data for you.

pip install instagramy