instaOAuth creates an OAuth access token that enables R to make authenticated calls to the Instagram API. The token can be saved as a file in disk to be re-used in future sessions. This function relies on the httr package to create the OAuth token, and is a simplified version of one of its examples.
To obtan your app_id and app_secret, do the following steps. First, go to http://instagram.com/developer/ and register your application with any name. Then, run the instaOAuth function with your "Client ID" and "Client Secret" as arguments. It will return a URL, which you will need to paste into the field "OAuth redirect_uri" in your application settings on Instagram. After changing it, press Enter in R. A new browser window will open and sign the token. If everything works works well, you will get a message that says you can return to R.
Examples
## Not run:## an example of an authenticated request after creating the OAuth token## where app_id and app_secret are fictitious, and token is saved for## future sessions my_oauth <- instaOAuth(app_id="123456789", app_secret="1A2B3C4D") save(my_oauth, file="my_oauth") load("my_oauth") obama <- searchInstagram(tag="obama", token=my_oauth)## End(Not run)