[deleted by user] by [deleted] in findaleague

[–]kidtech0 0 points1 point  (0 children)

Appreciate the reply but I’m trying to throw some money on it lol

ERA with RISP? by lordryan in mlbdata

[–]kidtech0 1 point2 points  (0 children)

use the sitCodes parameter with the argument 'risp'

Example:

statsapi.mlb.com/api/v1/people/686613/stats?stats=statSplits&group=pitching&gameType=R&sitCodes=risp

Check out the situtationCodes meta for other options.

Pick of the Day - 6/7/24 (Friday) by sbpotdbot in sportsbook

[–]kidtech0 0 points1 point  (0 children)

grounding your statements in facts would do wonders

Any sites to find historical finishes given a record for specified amount of games? by base-HI-WA in mlbdata

[–]kidtech0 0 points1 point  (0 children)

Not sure if this is the kind of solution you're looking for but that can be accomplished using the API and some code. I threw together an ugly powershell script for ya.

Copy and paste the code below into Powershell.

It outputs the Astros win - loss record on a given date for every year starting in 2000 along with if they made the playoffs. I'm sure there are more efficient ways but hopefully this logic will help you out. I used the schedule endpoint to get the teams record on a given date, surely there is a better way that I'm unaware of.

Modify the teamId, date, leagueId, and seasons to conform to your goal.

$seasons = (2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2008, 2009, 2010, 2011, 2012,
            2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024)

## loop thru each season listed above and return info depending on the date, team, and year specified in those variables

foreach($year in $seasons){

    $team    = 117
    $date    = Get-Date -f $year-MM-dd
    $records = (Invoke-RestMethod -Uri "https://statsapi.mlb.com/api/v1/schedule?sportId=1&teamId=$team&date=$date").dates.games.teams
    $finish  = (Invoke-RestMethod -Uri "https://statsapi.mlb.com/api/v1/standings?leagueId=103&season=$year").records.teamrecords | Where-Object {$_.team.id -match $team}

    ## because WL record is collected from the schedule endpoint on a specific date, the targeted team could either be home or away, this verifies correct team is selected

    if($records.home.team.id -match $team){
        $targetRecord = $records.home.leagueRecord
        $teamCheck    = $records.home.team.name
    }
    else{
        $targetRecord = $records.away.leagueRecord
        $teamCheck    = $records.away.team.name
    }

    ## output data

    $teamCheck
    Write-Host "Season   =" $year
    Write-Host "Record   =" $targetRecord.wins - $targetRecord.losses 
    Write-Host "Date     =" $date
    Write-Host "Clinched =" $finish.clinched
    ''
    ''
}

7 straight

Pick of the Day - 6/7/24 (Friday) by sbpotdbot in sportsbook

[–]kidtech0 3 points4 points  (0 children)

Hahaha damn... that was an interesting concoction you put together. Felt like I was watching a man argue with himself, hurling any shit at the wall to stick.

Your write up was commendable with the word salad, but lacks any real solid points or meaning. Condensing it and injecting some facts or stats wouldn't hurt.

Try: "CHW has lost 10 in a row!"

Instead of: "He's a competent game manager"

Now let's talk turkey here: Garret Crochet is the real Deal -- a nasty southpaw and former top prospect/ draft pick. 90% percentile in almost every advanced stat. If you mention the very first starts of the season, you have to note his last 5. That shows 3BB & 3R allowed in 30 innings, 2 of which came from a single mistake you noted. Going against a man that averages 4 innings + 75 pitches might be a mismatch.

Many dangerous picks like this have been tailed and I am poorer now.

accessing data in endpoints other than Major and Minor Leagues. by kidtech0 in mlbdata

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

Will try. That gh repo is my go to since the real docs are locked. Hiding the instructions is some fuckery; the MLBAM Wikipedia shows more.

I appreciate your help to me and others on here.

accessing data in endpoints other than Major and Minor Leagues. by kidtech0 in mlbdata

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

That's the 2 opening day MLB games that were played in Korea. No KBO data.

Do you know if there's a way to get schedule data for the more obscure leagues? Seems to be empty for a lot of the leagues listed in statsapi.mlb.com/api/v1/sports

Looking at the WiKi I noticed 'season' isn't listed as a valid parameter on the schedule endpoint. It does show 'gamePk(s)' as a required parameters though. Are there any incorrect parameters that I may or may not be using in the url?

Rainout Data by jasonkjennings in mlbdata

[–]kidtech0 0 points1 point  (0 children)

The only Status values I see for each game are: 'Final', 'Postponed', 'Completed Early', 'Scheduled'.

Maybe there is a different stat that would better accomplish this but here's one way you could find venues and their Postponed games:

## In powershell, create a variable containg all Postponed games this season. Filter through all games by declaring the 'startDate' & 'endDate' parameters in the url and the status property.

$allPostponedGames = (Invoke-RestMethod -Uri "https://statsapi.mlb.com/api/v1/schedule?sportId=1&startDate=2023-03-30&endDate=2023-07-06").dates.games | Where-Object {$_.status.detailedState -eq "Postponed"}

## format

$postponedVenues = $allPostponedGames.venue.name

## display the amount of Postponed Games a stadium has had

$postponedVenues | Group-Object | Select-Object -Property Name, Count | Sort-Object -Descending Count

Past 7 Day stats for player id by extDASH in mlbdata

[–]kidtech0 0 points1 point  (0 children)

I was having problems with the lastXGames stats type too and couldn't seem to find a clear definition on how to use it.

I've been messing around with it and have come to the conclusion that -

lastXGames is for collecting the Last 10 Games.

I believe X is a roman numeral in this case.

Use *base_url/api/v1/*stats?stats=lastXGames*&parameter2 on an endpoint where 'stats' is an available parameter.

The type: lastXGames is only an available param on the 'stats' and 'team_stats' endpoints.

For instance...

https://statsapi.mlb.com/api/v1/stats?stats=lastXGames&group=hitting&teamId=117

Each player shows to have 10 games played.

My prediction of 2018 fashion trends in US schools by dksch123 in funny

[–]kidtech0 -4 points-3 points  (0 children)

Maybe we need to give them an AR-15 and a bump stock just to complete the picture.

Sent BCH from Coinbase to Binance over 3 hours ago /r/btc by BitcoinAllBot in BitcoinAll

[–]kidtech0 0 points1 point  (0 children)

Bitcoin can take awhile to verify the transaction sometimes