Uses Instagram api to get a user's media
See instagramapi.html
Sample code for using the Instagram api
instagramapi.js has 2 functions to retrieve user media, one that requires authorization and one that does not.
- function getUserMediaNoAuth(user, count)
user: instagram user
count: number of media to return up to a max of 20 - function getUserRecentMedia(user, count)
user: instagram user
count: number of media to return
3. instagramapi.php has 2 functions and serves as a proxy for the above 2 api's
a. function getUserMediaNoAuth ($username)
instagram endpoint: https://www.instagram.com/username/media/
Does not require authorization and is undocumented, so may not be officially supported.
b. function getUserRecentMedia($username, $count)
instagram endpoint: https://api.instagram.com/v1/users/USER-ID/media/recent/?access_token=ACCESS-TOKEN
Supported api that requires authorization.
Update accesstoken.php, replacing ACCESS-TOKEN with your value. See readme.txt for steps to retrieve your access-token.
4. instagramapi.html has usage examples for these functions.
https://www.instagram.com/developer/endpoints/users/
- From instagramapi directory, startup a php webserver as follows: php -S localhost:8000
- From a browser, navigate to url: http://localhost:8000/instagramapi.html