RAWG Video Games Database

KOSTENLOS
Durch accujazz | Aktualisiert vor 3 Monaten | Gaming
Popularität

9.8 / 10

Latenz

288ms

Service Level

100%

Zurück zu allen Diskussionen

401 error even though I am using my API key

avatar
Anghel-Lucian
vor 5 Monaten

Hello!

I am trying to make a GET request to this endpoint:
https://api.rawg.io/api/games?key=api_key_here&dates=2019-09-01,2019-09-30&platforms=18,1,7”

As said in the title, I get a 401 error. I used fetch with in-browser JavaScript. Does the API not allow this kinds of requests?

Note: I took into account CORS policy when making the request, still the error is not referring to it, but to something else.

Thanks!

avatar
DenysPavlenko commented vor 5 Monaten

Hi there.
You can use rawg api directly.

here is an example with js fetch:

get the details of the game with id ‘3498’:

fetch(‘https://api.rawg.io/api/games/3498?key=YOUR_RAWG_API_KEY’)
.then(res=>res.json)
.then(res=>console.log(res))

You can place ?key to the end of the url
avatar
godwinsilayo100 commented vor 4 Monaten

can’t I use python to do the same?

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen
Bewertung: 4.4 - Stimmen: 24