RAWG Video Games Database

무료
분류별 RAWG | 업데이트됨 13 days ago | Gaming
인기

9.7 / 10

지연 시간

497ms

서비스 수준

93%

Health Check

N/A

모든 토론으로 돌아가기

401 error even though I am using my API key

Rapid account: Anghel Lucian
Anghel-Lucian
3 years ago

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!

Rapid account: Godwinsilayo 100
godwinsilayo100 Commented 3 years ago

can’t I use python to do the same?

Rapid account: Denys Pavlenko
DenysPavlenko Commented 3 years ago

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

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입