1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

Instagram Scraping using R

Discussion in 'Instagram' started by Chris B, Aug 25, 2017.

  1. Chris B

    Chris B Newbie

    Joined:
    Jun 29, 2017
    Messages:
    24
    Likes Received:
    1
    Gender:
    Male
    *If this is the wrong forum for this question, I apologize. Please point me to the correct one*

    Hello all,

    I am trying to scrape Instagram with R (I also know some Python but definitely prefer R) and I am finding it very difficult.

    Does anyone have a good resource for this? The resources i have found online are all directions made years ago, but since then instagram has changed its API policy. I am not trying to do anything too crazy, just save the details for my posts in a tabular format (time posted, amount of likes, amount of comments, etc)

    If anyone has any good resources, please let me know.

    Thanks
     
  2. blackh4t

    blackh4t Regular Member

    Joined:
    Jan 30, 2009
    Messages:
    339
    Likes Received:
    99
    Location:
    #1
  3. JustChillin

    JustChillin Elite Member

    Joined:
    Apr 14, 2015
    Messages:
    1,815
    Likes Received:
    1,161
    The easiest way is by using the private API. There are many documentations of it on github, especially in Python.
     
  4. Javardo69

    Javardo69 Junior Member

    Joined:
    Jul 19, 2014
    Messages:
    117
    Likes Received:
    9
    you just need to scrape the json data, instagram its relatively easy to scrape. You have to explore more the developer tools on your browser, its not a question if R or python its better.
     
  5. Chris B

    Chris B Newbie

    Joined:
    Jun 29, 2017
    Messages:
    24
    Likes Received:
    1
    Gender:
    Male
    Thanks
    Do you know of any websites or anything that go into more detail?
     
  6. Google Prince

    Google Prince Jr. VIP Jr. VIP

    Joined:
    Dec 24, 2015
    Messages:
    191
    Likes Received:
    151
    Location:
    Google's Search Engine
    I never used R but after doing a quick search, here's the IG api: github
    &
    If your looking to not use an api, then use this http library called httr: github
    Also a helpful guide using httr
     
  7. blackh4t

    blackh4t Regular Member

    Joined:
    Jan 30, 2009
    Messages:
    339
    Likes Received:
    99
    Location:
    #1
    Yes there is many examples, just use Google :)
     
  8. Chris B

    Chris B Newbie

    Joined:
    Jun 29, 2017
    Messages:
    24
    Likes Received:
    1
    Gender:
    Male
    Thanks for all of the help.

    Actually doing the data mining in R is not the problem. It is connecting to Instagram via R is what I'm struggling with. I keep receiving errors when I try to connect.
     
  9. mnunes532

    mnunes532 Elite Member

    Joined:
    Jan 21, 2014
    Messages:
    1,758
    Likes Received:
    600
    Gender:
    Male
    Location:
    Portugal
    What kind of errors? You simply need to send raw http requests, get the json data back and do stuff with it.
     
  10. cryptons

    cryptons Supreme Member

    Joined:
    Jun 12, 2013
    Messages:
    1,398
    Likes Received:
    485
    Occupation:
    Developer,social marketer
    You can use scraper package to extract data in json through python a easy one!
     
  11. Chris B

    Chris B Newbie

    Joined:
    Jun 29, 2017
    Messages:
    24
    Likes Received:
    1
    Gender:
    Male
    Can I PM you?
     
  12. mnunes532

    mnunes532 Elite Member

    Joined:
    Jan 21, 2014
    Messages:
    1,758
    Likes Received:
    600
    Gender:
    Male
    Location:
    Portugal
    sure, but I don't know R and I only know a bit of python.
     
  13. Javardo69

    Javardo69 Junior Member

    Joined:
    Jul 19, 2014
    Messages:
    117
    Likes Received:
    9
    learn how to do a get/post requests, apply headers, read json data, thats all you need to learn to scrape instagram, also of course know how to work with network tab of developer tools on chrome.