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.
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 code) in the current working directory of R. The working directory of R can be changed using the function setwd()
. You can explore the content downloaded using the below code. The function names
will give the various columns present in the data:
names...