Skip to content

New port of Instagram graph API, which is provided by facebook

License

Notifications You must be signed in to change notification settings

daryasary/instagram-graph-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graph API

Python library to connect instagram graph API and get data.

Usage

First get an access_token from here

from graph_api import InstagramGraphHandler

# Get account data 
handler = InstagramGraphHandlers(access_token=<your-access_token>, 
                                 account_id=<your-instagram-account-id>)
account_data = handler.account_data.get()

# Get media data
handler = InstagramGraphHandlers(access_token=<your-access_token>, 
                                 media_id=<instagram-media-id>)
media_comments = handler.media_comments.get()

# Pagination support
while handler.media_comments.graph.has_next():
    media_comments.extend(handler.media_comments.get())

##Notes:

  • All .get() API call only return one page response and you should loop over next pages urls.
  • All handlers are available stand alone from graph_api.handler path

##Todo:

  • Add token extender to exchange short-live token to long-live

About

New port of Instagram graph API, which is provided by facebook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages