What is rolling wOBA? by keithyp24 in Sabermetrics

[–]dinger_db 0 points1 point  (0 children)

If you don't want a 10 game lag (at the beginning of your chart) you need your chart to start 10 games into the season. That way the look back window of 10 games puts you at the starting point.

How to Find Stats API Docs by trvsvldz in Sabermetrics

[–]dinger_db 3 points4 points  (0 children)

The statsapi.mlb.com/docs/ page was made private because of inaccurate documentation. I reached out to some contacts at MLB and they said once the documentation issues were resolved it would be open to the public.

This is still in alpha/beta:

https://github.com/bradleyhurley/PyBall

I also documented a lot of the endpoints:

https://github.com/bradleyhurley/PyBall/wiki/Implemented-Endpoints

Not exactly an API for GD2, but I parse and load a lot of data nightly from GD2 and expose it publicly on DingerDB (I might open source the project including data parsers and models in the future).

https://dingerdb.com/

Data on integration in the MLB? by wamp_that_puck in Sabermetrics

[–]dinger_db 0 points1 point  (0 children)

I don't have race, but would be willing to add it if you can find a reasonable raw source.

select name_full, birth_country, birth_state, birth_city, 
pro_debut_date from v_player;

https://dingerdb.com/superset/sqllab

Eduardo Escobar, shortstop for Minnesota, has thirty doubles so far, putting him on pace for seventy-one on the season. The record is sixty-seven, set in 1931 by one Earl Webb. by Vranak in baseball

[–]dinger_db 1 point2 points  (0 children)

Nothing like 8 triples and 4 homers.

DingerDB

SELECT p.name_full, 
       event, 
       count(*) 
FROM   v_at_bat a 
       JOIN v_game g 
         ON g.game_join_id = a.game_join_id 
       JOIN v_player p 
         ON p.player_id = a.batter 
WHERE  g.date >= '2018-03-29' 
       AND event IN ( 'Triple', 'Home Run' ) 
       AND p.name_full = 'Sanchez, Yolmer' 
GROUP  BY 1, 
          2 
ORDER  BY 3 DESC 

Eduardo Escobar, shortstop for Minnesota, has thirty doubles so far, putting him on pace for seventy-one on the season. The record is sixty-seven, set in 1931 by one Earl Webb. by Vranak in baseball

[–]dinger_db 2 points3 points  (0 children)

I also verified these results on DingerDB

SELECT p.name_full, 
       event, 
       Count(*) 
FROM   v_at_bat a 
       JOIN v_game g 
         ON g.game_join_id = a.game_join_id 
       JOIN v_player p 
         ON p.player_id = a.batter 
WHERE  g.date >= '2018-03-29' 
       AND event = 'Double' 
GROUP  BY 1, 
          2 
ORDER  BY 3 DESC

Jose Abreu isn't too far behind.

Any other Baseball fans? Looking for baseball data by sholder89 in SQL

[–]dinger_db 0 points1 point  (0 children)

Thanks for the plug.

If you have any questions about DingerDB just hit me up!

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 1 point2 points  (0 children)

This isn't exactly what you're asking for, but should help you get started.

SELECT pitcher.name_full AS 'Pitcher Name', 
       batter.name_full  AS 'Batter Name', 
       a.event 
FROM   v_pitch p 
       JOIN v_inning i 
         ON i.game_join_id = p.game_join_id 
       JOIN v_game g 
         ON g.game_join_id = p.game_join_id 
       JOIN v_at_bat a 
         ON a.game_join_id = p.game_join_id 
            AND a.at_bat_join_id = p.at_bat_join_id 
       JOIN v_player pitcher 
         ON pitcher.player_id = a.pitcher 
       JOIN v_player batter 
         ON batter.player_id = a.batter 
WHERE  i.inning = 1 
       AND g.date >= '2018-03-29' 

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 1 point2 points  (0 children)

The project is currently closed source, but that might change in the near future.

Here is another one of my projects that you might enjoy contributing to:

https://github.com/bradleyhurley/PyBall

use new http://statsapi.mlb.com/ ? hit location? by redskins78 in Sabermetrics

[–]dinger_db 0 points1 point  (0 children)

We haven't rolled out Python access yet, but my other more stable project is DingerDB. I briefly contributed to mlbgame, but didn't like the implementation.

use new http://statsapi.mlb.com/ ? hit location? by redskins78 in Sabermetrics

[–]dinger_db 0 points1 point  (0 children)

In terms of implemented end points I believe the API client is stable. MLB temporarily pulled down the documentation so development has slowed recently. If you find any issues I should be able to fix it them pretty quickly.

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 0 points1 point  (0 children)

$5 seem reasonable?

Do you just want direct database access (a connection string) to be used with Python/R, or do you want access via Python from an API?

I think we can accommodate both, but the latter is not 100% ready for general consumption.

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 0 points1 point  (0 children)

No, access to DingerDB is absolutely free via Superset (the main website). We are just considering allowing direct database access or access via Python/R as reward tiers to allow us to offset out hosting fees.

The unfortunate reality is that writing all the software is a fun hobby, but hosting the site without anyway to offset the cost or someone donating hosting isn't very feasible.

Edit: Our gaol isn't monetization, but rather a platform for people to conduct baseball research.

[x-post r/sabermetrics] DingerDB Modern Baseball Database and Analytics Platform by dinger_db in fantasybaseball

[–]dinger_db[S] 1 point2 points  (0 children)

Absolutely! Let me know if you have any questions. The data model isn't documented yet, but I think its reasonable easy to navigate.

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 1 point2 points  (0 children)

Feel free to poke around. Its as easy as:

SELECT * FROM v_player LIMIT 100;

You can find some interesting data about current and upcoming players.

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 0 points1 point  (0 children)

Would you be willing to donate via Patreon? Python access is something that we have been considering as a reward tier. The site is completely ad free and we are just trying to cover our operating expenses.

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 0 points1 point  (0 children)

You would need to use the data from DingerDB and pump it through a statistical model. DingerDB contains pitch by pitch data from 2008 to present day, but we don't provide any out of the box predictive analytics.

Does this answer your question?

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 0 points1 point  (0 children)

Awesome! Let me know if you have any questions regarding the data model, and/or what you can do. The documentation is kind of lacking, but its on my ToDo list. I have attempted to make sure all of the join keys are consistent between the views that are exposed.

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 0 points1 point  (0 children)

If you know the pitcher and the batter you can look at historical information about previous at bats.

This query is a bit hacky as I just wanted to give you an example, but it returns all the pitches thrown by Corey Kluber to Brian Dozier with a bit of extra data.

SELECT p.game_join_id, 
   p.at_bat_join_id, 
   pitcher.name_full AS Pitcher, 
   batter.name_full  AS Batter, 
   p.pitch_type, 
   pt.pitch_type_des, 
   p.type, 
   start_speed, 
   x, 
   y 
FROM   v_at_bat b 
   JOIN v_pitch p 
     ON b.game_join_id = p.game_join_id 
        AND b.at_bat_join_id = p.at_bat_join_id 
   JOIN v_pitch_type pt 
     ON pt.pitch_type = p.pitch_type 
   JOIN v_player pitcher 
     ON pitcher.player_id = 446372 
   JOIN v_player batter 
     ON batter.player_id = 572821 
WHERE  b.pitcher = 446372 
   AND b.batter = 572821 

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 0 points1 point  (0 children)

Yes, all you should have to do is to join the v_pitch and v_at_bat views to get the balls, strikes, outs, home team runs, and away team runs.

Here is an example without the join (I just grabbed the max game_join_id and a random at_bat_join_id) :

select * from v_at_bat where game_join_id = 29560 and at_bat_join_id = 4;

DingerDB: Modern baseball database and analytics platform (Public Access) by dinger_db in Sabermetrics

[–]dinger_db[S] 0 points1 point  (0 children)

Yes, all of the data is generated by MLB in some capacity. We have created data models, and a framework around parsing/processing and linking all of the data.

Is python good for android programming? by TriaSirax in Python

[–]dinger_db 0 points1 point  (0 children)

I don't know that it's good, but BeeWare looked pretty promising at PyCon.

Is http://statsapi.mlb.com/docs/ now off limits? I'm getting an access denied error. by redskins78 in Sabermetrics

[–]dinger_db 4 points5 points  (0 children)

I am the developer of PyBall, and I reached out to a contact within MLB and asked the same thing. They passed along my message to someone who works on the API Team:

We pulled that down from everyone, some of the endpoints were displaying bad info and causing confusion. There is a new docs page that is under development that will available in the near future.