You may interact with Facebook’s Graph API using the GraphAPI class:
from facepy import GraphAPI
graph = GraphAPI(access_token)
# Get my latest posts
graph.get('me/posts')
# Post a photo of a parrot
graph.post(
path = 'me/photos',
source = open('parrot.jpg')
)
# Make a FQL query
graph.fql('SELECT name FROM user WHERE uid = me()')
# Make a FQL multiquery
graph.fql({
'rsvp_status': 'SELECT uid, rsvp_status FROM event_member WHERE eid=12345678',
'details': 'SELECT name, url, pic FROM profile WHERE id IN (SELECT uid FROM #rsvp_status)'
}
Get an item from the Graph API.
Parameters: |
|
---|
Floating-point numbers will be returned as decimal.Decimal instances.
See Facebook’s Graph API documentation for an exhaustive list of parameters.
Post an item to the Graph API.
Parameters: |
|
---|
See Facebook’s Graph API documentation for an exhaustive list of options.
Delete an item in the Graph API.
Parameters: |
|
---|
Search for an item in the Graph API.
Parameters: |
|
---|
Supported types are post, user, page, event, group, place and checkin.
See Facebook’s Graph API documentation for an exhaustive list of options.
Make a batch request.
Parameters: | requests – A list of dictionaries with keys ‘method’, ‘relative_url’ and optionally ‘body’. |
---|
Yields a list of responses and/or exceptions.
Use FQL to powerfully extract data from Facebook.
Parameters: |
|
---|
See Facebook’s FQL documentation for an exhaustive list of details.