본문 바로가기

Minding's Baseball/MLB Statcast

[MLB Stats API] statsapi.notes(endpoint)

728x90
반응형

[MLB Stats API] 파이썬 패키지로 MLB Stats API 사용해보기

 

[MLB Stats API] 파이썬 패키지로 MLB Stats API 사용해보기

Fangraph나 MLB savant 홈페이지에서 직접 csv, DB파일을 다운로드 받는 것이 아닌 MLB서버에 연결된 API로 손쉽게 데이터를 구할 수 있는 방법을 야구공작소 글을 보며 알게되었다. 그 중 파이썬으로 API

minding-deep-learning.tistory.com


  • 지정된 endpoint에 둘 이상의 고유 매개변수가 필요한 경우
    (예: teamId, legueId 또는 legueListId 중 하나가 endpoint에 포함되어야 함)
  • 필요 매개변수 목록에는 각 요구사항 집합에 대한 하위 목록이 포함됨

예시 : awards 엔드포인트에 필요한 매개변수들과 하위목록에 대한 설명

statsapi.notes('awards')

>>>
"Endpoint: awards \nAll path parameters: ['ver', 'awardId', 'recipients']. \nRequired path parameters (note: ver will be included by default): ['ver']. \nAll query parameters: ['sportId', 'leagueId', 'season', 'hydrate', 'fields']. \nRequired query parameters: None. \nThe hydrate function is supported by this endpoint. Call the endpoint with {'hydrate':'hydrations'} in the parameters to return a list of available hydrations. For example, statsapi.get('schedule',{'sportId':1,'hydrate':'hydrations','fields':'hydrations'})\nDeveloper notes: Call awards endpoint with no parameters to return a list of awardIds."
728x90