Mid-event TBA API responses?

Is there a way to see sample responses from TBA API calls as they would exist while an event is in progress? One particular example I’m looking for is the mid-event response from /event/{event_key}/matches, but there are others as well. The schemas in swagger sometimes have helpful information about the mid-event data that should be expected (e.g. /alliances/blue/score - “Score for this alliance. Will be null or -1 for an unplayed match.”). However for other keys there isn’t any information about mid-match contents (e.g. /actual_time - one would assume that this key would have null or maybe some placeholder like -1 for an unplayed match, but the schema does not specify).

I’ve made some assumptions about mid-match responses in previous seasons when developing applications that use TBA data. However, I’ve had to wait for a week 0 event to do final application testing and debugging when mid-match API responses were available. I’ve never been organized enough to run through the API and save mid-event responses for future development purposes during week 0 or any other matchweek. My hope is that someone else has happened to do that or that there is some other way to generate mid-event responses on demand.

The extent of my work with the API has mostly been for my scouting app generating a table of upcoming and past matches, but the feel that I’ve gotten is generally it’s hard to get mid-match updates from TBA. I’d rate the reliability with sketchy at best. However, getting post-match results and stats from the app is pretty reliable. Usually a few minutes after a match I’ll be able to put the match results into the database without much issue. Just in general I’ve found that getting automatic updates on events is pretty easy as long as you give a 3-5 minute rest period after each match before trying to query the API to prevent having non-existent data.

The way I’ve been using TBA in my scouting app (it’s web based) is there is a function that an admin can use that queries the TBA’s match record table and populates a table within my app with that data, and replacing all empty data with 0 or some other character that symbolizes null data

It looks like I sloppily interchanged mid-match and mid-event in my post, which is confusing. I’m interested in the mid-event API responses, the ones after a match has been completed and there has been time to include a new match record in the API response. The main question is what is in certain JSON keys for matches yet to be played or playoff matches yet to have teams assigned. Are there nulls, placeholders like -1, JSON strings with sub-keys, but null or placeholder values, or anything else?

Chezy Champs should have TBA live sync enabled, so you will be able to get mid-event data during it. It should be easier given that it’s a 2 day event, so you’ll have an entire evening to grab a few endpoints and save the responses.

1 Like

That’s a great idea, assuming that you’re right about the TBA live sync. It’s soon enough to be useful for fall development, but not so soon that I can’t put a plan together to collect mid-event responses. I need to mark my calendar. Thanks!

If you really want to do this without waiting for a real event, you could following these instructions: Development Runbook · the-blue-alliance/the-blue-alliance Wiki · GitHub. However, if you’re only purpose is to see mid-event API responses, it’s a lot of work.

I agree that Chezy Champs is a good opportunity to test this.

I can also say that if you pull the event/{event-code}/matches endpoint for a completed event and an event that hasn’t yet started but has a match schedule published, you can extrapolate what the mid-event API looks like (some completed matches, some scheduled matches)

Reading the source can be helpful as well, if you’re confident in poking around the code a little bit. Here’s how we go from our internal Match model to an API response https://github.com/the-blue-alliance/the-blue-alliance/blob/ed7a9eeba86ffb3c34580c30ccd96bfa5ec4c089/src/backend/common/queries/dict_converters/match_converter.py#L36

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.