All Projects → erwstout → node-mlb-api

erwstout / node-mlb-api

Licence: MIT License
A Node.js wrapper for the new MLB Stats API.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-mlb-api

mysportsfeeds-api
Feature requests for the MySportsFeeds Sports Data API.
Stars: ✭ 44 (+144.44%)
Mutual labels:  sports, mlb
Sportsipy
A free sports API written for python
Stars: ✭ 229 (+1172.22%)
Mutual labels:  sports, stats
css-almanac
Repo for planning & voting on which stats to study
Stars: ✭ 33 (+83.33%)
Mutual labels:  stats
scoreboard
CRG Derby Scoreboard
Stars: ✭ 83 (+361.11%)
Mutual labels:  sports
stargazer
A app that gives you some statistics about your public Github repositories.
Stars: ✭ 36 (+100%)
Mutual labels:  stats
wink-statistics
Fast & numerically stable statistical analysis
Stars: ✭ 36 (+100%)
Mutual labels:  stats
stats
📊 Statistics generator for Facebook Groups
Stars: ✭ 50 (+177.78%)
Mutual labels:  stats
PyStalker
Python script to see you what your friends are doing on Codeforces!
Stars: ✭ 12 (-33.33%)
Mutual labels:  stats
flask-react-d3-celery
A full-stack dockerized web application to visualize Formula 1 race statistics from 2016 to present, with a Python Flask server and a React front-end with d3.js as data visualization tool.
Stars: ✭ 20 (+11.11%)
Mutual labels:  sports
Qubes-scripts
Scripts that help with administration and usage of Qubes OS
Stars: ✭ 33 (+83.33%)
Mutual labels:  stats
Strava-Analysis-Tool
A Python tool to analyze and display Strava activity data.
Stars: ✭ 32 (+77.78%)
Mutual labels:  sports
fittrak
A data-driven workout tracking tool for the quantified-self 💪 🤓
Stars: ✭ 19 (+5.56%)
Mutual labels:  stats
cfbscrapR
A scraping and aggregating package using the CollegeFootballData API
Stars: ✭ 25 (+38.89%)
Mutual labels:  sports
brackets-viewer.js
A simple library to display tournament brackets (round-robin, single elimination, double elimination).
Stars: ✭ 52 (+188.89%)
Mutual labels:  sports
replay-table
A javascript library for visualizing sport season results with interactive standings
Stars: ✭ 67 (+272.22%)
Mutual labels:  sports
math-stats
A small library that does the statistics for your numbers.
Stars: ✭ 18 (+0%)
Mutual labels:  stats
Trakt-Userscripts
Userscripts to improve and add features to Trakt.tv
Stars: ✭ 39 (+116.67%)
Mutual labels:  stats
IPL-ML-2018
Predicting IPL match results. https://kuharan.github.io/IPL-ML-2018/
Stars: ✭ 14 (-22.22%)
Mutual labels:  sports
retrosheet
Project to parse retrosheet baseball data in python
Stars: ✭ 19 (+5.56%)
Mutual labels:  sports
eureka
✍️ I read, I write, I think, I do, I learn, I code.
Stars: ✭ 106 (+488.89%)
Mutual labels:  sports

node-mlb-api

Build Status npm version

A Node.js wrapper for the new MLB API.

⚠️ RIP API

It looks like MLB has taken down the endpoints this repo hit to gather information. I'll be looking into other means, but for now this repo is useless. 🙃

Getting Started

Install via npm npm install node-mlb-api --save

Use in your Node.js application

const MLBApi = require("node-mlb-api");

const games = MLBApi.getGames();

Available Functions

All functions return a promise containing the JSON response.

getGames()

Get a list of games. Accepts an optional date argument as a string (MM/DD/YYYY) to get particular date. If no argument is passed it will get the current day.

MLBApi.getGames("03/03/2018");

getTeams()

Accepts optional argument for singleTeamId to only return information from one team. Otherwise it will return all 32 teams.

MLBApi.getTeams(133); // returns Oakland Athletics - see the MLB Stats documentation for IDs

getGameFeed()

Gets a single game's live feed. Accepts a required argument of the gamePk id.

MLBApi.getGameFeed(533786); // Tigers vs. Yankees 02/23/2018

getLinescore()

Gets a single game's linescore. Accepts a required argument of the gamePk id.

MLBApi.getLinescore(533786); // Tigers vs. Yankees 02/23/2018

getBoxscore()

Gets a single game's boxscore. Accepts a required argument of the gamePk id.

MLBApi.getBoxscore(533786); // Tigers vs. Yankees 02/23/2018

getColorFeed()

Gets a single game's color feed. Accepts a required argument of the gamePk id. Beware, the payload for this can get very large - see the disclaiming on the MLB Stats API to learn more and how to manage the data responsibly.

MLBApi.getBoxscore(533786); // Tigers vs. Yankees 02/23/2018

getStandings()

Gets regular season standings by League. Accepts a required string argument of league ('AL' / 'NL') and an optional year argument (YYYY). The response from the API is broken up by division.

MLBApi.getStandings("NL", 2017); // 2017 NL Standings

MLB Stats API

The MLB Stats API documentation can be found here

NOTICE: This is NOT an official MLB product or affiliated with MLB in anyway.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].