2
votes

there is any way to get the access token automatically with python using login informations ?

Something like this :

import requests

r=requests.get('https://graph.facebook.com/oauth/access_token?grant_type=get_token& client_id=idclient_secret=password&privilege=')

print r.text

1
That is of course not possible. - WizKid

1 Answers

1
votes

As far as I know you can't get users access token without users interaction.

You can get app token though like this:

facebook.get_app_access_token(APP_ID, APP_SECRET)

To get APP_ID and APP_SECRET you need to create new app here: https://developers.facebook.com/ Note that you will get much less meta data using app's token than using user's token.

I was writing script collecting data from facebook lately and I had same problem. I just switched to app token since my script runs every hour as cron job so it was impossible to deliver new token every time manually.