Hello, when running the following code -
def fetch_football_data(session_token):
url = "https://api.betfair.com/exchange/betting/rest/v1.0/listMarketCatalogue/"
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {session_token}'
}
data = {
"filter": {
"eventTypeIds": [1], # 1 corresponds to Football
"marketTypeCodes": ["MATCH_ODDS"], # Example: Only fetch Match Odds markets
},
"marketProjection": ["EVENT", "COMPETITION", "RUNNER_DESCRIPTION", "MARKET_START_TIME"],
"maxResults": 10
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
return response.json()
else:
print("Failed to fetch football data from Betfair API.")
print("Response status code:", response.status_code)
print("Response content:", response.content)
return None
I am receiving this error -
runcell(0, 'C:/Users/cdye/OneDrive/Desktop/ArbBetfairScripts/API_get_data_newest.py')
Failed to fetch football data from Betfair API.
Response status code: 400
Response content: b'{"faultcode":"Client","faultstring":"ANGX-0004","detail":{"APINGException":{"requestUUID":"i e1-ang06a-prd-01290905-0069ec111b","errorCode":"NO_APP_KEY","errorDetails ":""},"exceptionname":"APINGException"}}'
Failed to fetch football data from Betfair API.
Is anyone able to advise as to why this is happening?
Thanks
def fetch_football_data(session_token):
url = "https://api.betfair.com/exchange/betting/rest/v1.0/listMarketCatalogue/"
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {session_token}'
}
data = {
"filter": {
"eventTypeIds": [1], # 1 corresponds to Football
"marketTypeCodes": ["MATCH_ODDS"], # Example: Only fetch Match Odds markets
},
"marketProjection": ["EVENT", "COMPETITION", "RUNNER_DESCRIPTION", "MARKET_START_TIME"],
"maxResults": 10
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
return response.json()
else:
print("Failed to fetch football data from Betfair API.")
print("Response status code:", response.status_code)
print("Response content:", response.content)
return None
I am receiving this error -
runcell(0, 'C:/Users/cdye/OneDrive/Desktop/ArbBetfairScripts/API_get_data_newest.py')
Failed to fetch football data from Betfair API.
Response status code: 400
Response content: b'{"faultcode":"Client","faultstring":"ANGX-0004","detail":{"APINGException":{"requestUUID":"i e1-ang06a-prd-01290905-0069ec111b","errorCode":"NO_APP_KEY","errorDetails ":""},"exceptionname":"APINGException"}}'
Failed to fetch football data from Betfair API.
Is anyone able to advise as to why this is happening?
Thanks


Comment