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.
numeric, Client ID of application to be used to create OAUth token. Available at http://instagram.com/developer
string, Client Secret of application to be used to create OAUth token. Available at http://instagram.com/developer.
string, specifies scope of access to the authenticated user data. See http://instagram.com/developer/authentication/#scope for available options.
To obtan your
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.
Pablo Barbera [email protected]
1 2 3 4 5 6 7 8 9 10
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.