ojin0611 / gameprofile

Edit and share your own game profile
0 stars 0 forks source link

게임 데이터 가져오기 #1

Open ojin0611 opened 1 year ago

ojin0611 commented 1 year ago

활용할 수 있는 게임 데이터 API를 찾아본다.

ojin0611 commented 1 year ago

Authentication

계정 생성, Two Factor Authentication 설정을 해준다. Application을 생성해준다. Client ID, Client Secret을 확인/생성한다. https://dev.twitch.tv/console/apps Client ID, Client Secret을 이용해 access token을 발급받는다. API 요청 시 Client ID와 access token을 header에 넘겨준다. https://api-docs.igdb.com/#examples

# header
Client-ID: ${client-id}
Authorization Bearer ${access_token}

API 요청하기

game 정보

Method: GET 
URL: https://api.igdb.com/v4/games
Body: search "Elden Ring"; fields *;

game cover art

Method: POST 
URL: https://api.igdb.com/v4/covers
Body: fields alpha_channel,animated,checksum,game,height,image_id,url,width; where game=119133;

Top 500 games after 2010

fields name,rating; # *
sort rating desc;
where rating != null & rating < 100 & first_release_date>946677600; # 2010