import requests
# Replace these values with your own
client_id = ''
client_secret = ''
access_token = ''
campaign_id = ''
# Authenticate with the Patreon API
auth_url = 'https://www.patreon.com/api/oauth2/token'
auth_data = {
'grant_type': 'client_credentials',
'client_id': client_id,
'client_secret': client_secret,
}
auth_response = requests.post(auth_url, data=auth_data)
access_token = auth_response.json()['access_token']
# Get the list of patrons
patrons_url = f'https://www.patreon.com/api/oauth2/v2/campaigns/{campaign_id}/members'
patrons_headers = {
'Authorization': f'Bearer {access_token}',
}
patrons_response = requests.get(patrons_url, headers=patrons_headers)
patrons = patrons_response.json()['data']
# Extract the names of the patrons
patron_names = [patron['attributes']['full_name'] for patron in patrons]
# Print the list of names
print(patron_names)
I took the code from here:
Now I cannot do anything, the docs does not tell anything, it lacks all important information.