I am using the Python facebook-sdk client library. I currently have a short-lived access token obtained from https://developers.facebook.com/tools/accesstoken/ that I copy the c
here's an edited version , compatible with latest api versions:
import requests
import json
access_token = 'your token' # Obtained from https://developers.facebook.com/tools/accesstoken/
app_id = "your app id" # Obtained from https://developers.facebook.com/
client_secret = "app secret" # Obtained from https://developers.facebook.com/
link = "https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id=" + app_id +"&client_secret=" + client_secret + "&fb_exchange_token=" + access_token
s = requests.Session()
token = s.get(link).content
token=json.loads(token)
token=token.get('access_token')
print token