import requests
# Ihre AWIN API-Zugangsdaten
api_token = '69521a99-d314-4683-ba36-31a0b020bd9d'
publisher_id = '1150573'
endpoint = 'https://api.awin.com/publishers/{}/transactions/'.format(publisher_id)
'pip install requests'
# Header und Parameter für die GET-Anfrage
headers = {
'Authorization': 'Bearer {}'.format(api_token)
}
params = {
'startDate': '2024-01-01T00:00:00',
'endDate': '2024-12-31T23:59:59',
'timezone': 'Europe/Berlin'
}
# GET-Anfrage an die AWIN API
response = requests.get(endpoint, headers=headers, params=params)
# Überprüfen, ob die Anfrage erfolgreich war
if response.status_code == 200:
sales_data = response.json()
print(sales_data)
else:
print(f"Fehler: {response.status_code} - {response.text}")