import requests
r = requests.get(
    'https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=123&client_secret=XXX'
    )
access_token = r.text.split('=')[1]
print(access_token)
How to connect to Facebook Graph API from Python using Requests if I do not need user access token?