Hi There!
I tried to run the tutorial “Get sorted predictions for tomorrow using Python” with Python on Jupyter notebook. However the code throws an error with API key.
How do i execute the following step in Jupyter notebook:?!
setx RAPIDAPI_KEY “my-secret-api-key” on a windows machine
I am unable to attach the screenshot. he image attachment link doesnt seem to be working.
Thanks looking forward to the response!
Únase a la conversación, añada un comentario a continuación:
Thank you for the response!
I replaced the key from the headers dict and the output received is as given below:
Bad response from server, status-code: 200
b’{“data”: [], “errors”: {“other”: “No data available. (requested: {‘federation’: ‘UEFA’, ‘iso_date’: ‘2021-09-07’, ‘market’: ‘classic’})”}}’
Why is it saying its an invalid request? Can i share the API key am using here??
Thank You.
Hi,
The example is based on best practices for security, the RAPIDAPI_KEY is to be treated as a secret.
However for testing purposes it is easier to just specify the key directly.
In the tutorial simply copy paste your api key in the headers dict, as a value for “X-RapidAPI-Key”
For information about how to get an api_key check https://docs.rapidapi.com/docs/consumer-quick-start-guide