Football Prediction

FREEMIUM
Por boggio | Actualizada vor 17 Tagen | Sports
Popularidad

9.9 / 10

Latencia

1,633ms

Nivel de servicio

100%

Health Check

N/A

Volver a todas las conversaciones

key in react.js

Rapid account: Carlos Giil 97
CarlosGiil97
vor 3 Jahren
Currently I am doing it like this:

const url = “https://football-prediction-api.p.rapidapi.com/api/v2/performance-stats”;

But I get an error that I am missing the api-key, how could I use it?

Thank you

Rapid account: Boggio Analytics
boggio-analytics Commented vor 3 Jahren

You need to provide an opts parameter when you do the fetch, something like this

    const opts = {
        headers: {
            Accept: "application/json",
            "Content-Type": "application/json",
            "X-RapidApi-Key": "YOUR_KEY",
            "User-Agent": "APP_NAME + VERSION"
        },
        cache: "no-cache",
    };

    fetch(url, opts)

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

Inicie sesió/Regístrese para publicar nuevos comentarios