본문 바로가기
파이썬

파이썬을 이용하여 피파온라인4 API를 사용해보자 #1 (개발자 Key 발급, 유저정보 조회)

by blacknabis 2023. 5. 8.

 

개발자 Key 발급 받기

 

https://developers.nexon.com/

 

개발자센터

넥슨 Open API를 활용하여 멋진 경험에 도전해보세요!! 게임 정보, 매칭 기록, 랭킹 지표 등 무궁무진한 데이터를 직접 활용해보세요!

developers.nexon.com

마이페이지 > 새 어플리케이션 등록

 

 

유저 닉네임으로 유저 정보 조회

import json
import pandas as pd
import requests

from pandas import DataFrame
from tqdm.notebook import tqdm

#User_Key에 본인이 발급 받은 user_key 입력
api_key = 'User_key'


headers = {'Authorization' : api_key}
jsonurl = "https://api.nexon.co.kr/fifaonline4/v1.0/users?nickname="
nickname = "둘리사우론"
try :
    response = requests.get(jsonurl + nickname, headers = headers) 
    json = response.json()

except Exception as e :
    print("Error message: ", e)