Football Prediction

FREEMIUM
Por boggio | Actualizada 4 days ago | Sports
Popularidad

9.8 / 10

Latencia

1,296ms

Nivel de servicio

100%

Health Check

N/A

Volver a todas las conversaciones

API Key Error

Rapid account: Ajitminj
ajitminj
3 years ago

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!

Rapid account: Ajitminj
ajitminj Commented 3 years ago

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.

Rapid account: Boggio Analytics
boggio-analytics Commented 3 years ago

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”

    headers = {
        'User-Agent': 'python_requests',
        "X-RapidAPI-Key": "YOUR API KEY" <- here
    }

For information about how to get an api_key check https://docs.rapidapi.com/docs/consumer-quick-start-guide

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios