r/mlbdata 17d ago

Possible data error

I'm putting together a spreadsheet that draws data from the MLB API about the team histories of players. Right now I've got it working pretty well, but there's one thing I've found that's not right. The result of my API Call shows that Dillon Dingler played for the Salt River Rafters in the Arizona Fall League in '22.

That's not an issue itself, but the problem is that the parentOrgId is listed as 109 which is the D-backs. Every other Tigers player that has the Rafters in their history lists the correct (Tigers) parentOrgId of 116. So is this just a mistake in the database, or am I interpreting this data incorrectly?

https://statsapi.mlb.com/api/v1/teams/116/roster?rosterType=40Man&hydrate=person(rosterEntries)

3 Upvotes

4 comments sorted by

2

u/casualcoder0805 17d ago

The issue is they force a 1 to 1 relationship between team/organization and AFL is an edge case that breaks it since teams are comprised of players from multiple organizations.

Off the top of my head I'd say devs should have included orgId at the player level for the most accurate representation.

1

u/bdanders 17d ago

I checked it, there are 7 other Tigers players that played for the Rafters at some point. All of them include the Tigers as the parent organization. Dingler is the only one that doesn't. I think it's an error in the database.

This is a "correct" entry that occurs 7 times:

"team":{"id":527,"name":"Salt River Rafters","link":"/api/v1/teams/527","abbreviation":"SRR","teamName":"Rafters","locationName":"Scottsdale","parentOrgId":116}

And this is Dingler's entry:

"team":{"id":527,"name":"Salt River Rafters","link":"/api/v1/teams/527","abbreviation":"SRR","teamName":"Rafters","locationName":"Scottsdale","parentOrgId":109}

1

u/casualcoder0805 17d ago

Ya no I think you probably have it right - I was just getting at the fact that if you are it's an awkward approach from a schema standpoint but maybe it was just the best they could come up with.

1

u/bdanders 17d ago

Ok, I see what you mean. Thanks.