O'Reilly logo

Mastering Social Media Mining with R by Vikram Garg, Sharan Kumar Ravindran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accessing data from R

The Instagram API provides access to some amazing content published on Instagram. It uses the OAuth 2.0 protocol for authentication and authorization as explained in the previous section. Let's see the functions present in the package instaR, which enables us to download data from R.

Searching public media for a specific hashtag

The function searchInstagram allows the users to download the public media posted on Instagram with a specific hashtag:

MachuPicchu<- searchInstagram("MachuPicchu", token, n=10, folder="MachuPicchu")

The preceding code will return the recent public media posts on Instagram with the hashtag MachuPicchu, and the media files will be downloaded in a folder named MachuPicchu (as specified in the preceding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required