Skip to content

euribe98/instagramapi

Repository files navigation

instagramapi

Synopsis

Uses Instagram api to get a user's media

Code Example

See instagramapi.html

Motivation

Sample code for using the Instagram api

Instructions

instagramapi.js has 2 functions to retrieve user media, one that requires authorization and one that does not.

  1. function getUserMediaNoAuth(user, count)
    user: instagram user
    count: number of media to return up to a max of 20
  2. 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.

API Reference

https://www.instagram.com/developer/endpoints/users/

Tests

  1. From instagramapi directory, startup a php webserver as follows: php -S localhost:8000
  2. From a browser, navigate to url: http://localhost:8000/instagramapi.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published