Closed gr33ngiant112 closed 5 years ago
Just to be clear, it seems you're saying the 2019-04-03 game is missing from the response, not the 2019-04-11 game, yeah? I'm basing that off you linking to the SG event page for the 04-03 game and that does appear to be missing from your output.
I'm not sure why this isn't working for you. Have you tried taking the formed URL and viewing it in your browser to validate the event isn't there?
https://api.seatgeek.com/2/events?client_id={client_id}&performers[home_team].id=26&venue.city=Cincinnati&datetime_utc.gte=2019-03-28&datetime_utc.lte=2019-10-30&venue.city=Cincinnati&format=json&per_page=100
shows it for me (replace my {client_id}
template with your client id)
BTW, you can make your request a little more specific and probably ever-so-slightly faster by changing venue.city=Cincinnati
to venue.id=26
:
https://api.seatgeek.com/2/events?client_id={client_id}&performers[home_team].id=26&venue.city=Cincinnati&datetime_utc.gte=2019-03-28&datetime_utc.lte=2019-10-30&venue.id=26&format=json&per_page=100
Finally, you don't need a client_secret
for these requests.
@dallasgutauckis Correct, apologies. Absolute copy/paste fail 🤦♂️ Updated. Yes, the April 3rd game wasn't and still isn't showing from my API call. There are others I found to be missing earlier but didn't record them.
Thanks for the efficiency tips, will implement!
I do however 100% see it with the template you posted. Again, 🤦♂️ The Formatted output I posted is a dict I built by looping through each event, grabbing the title and datetime_local value so idk wtf I'm doing wrong. I get almost every other game but a few, the April 3rd one included.
events = get_events(performer_id, endpoint, current_year, client_id, client_secret, proxies)
# Build our new events dict
schedule = {}
for key, val in events.items():
if key == "events":
for event in val:
schedule.update({event['title']:event['datetime_local']})
Formatted output I pasted above is from the schedule{} dict.
Yeah, so I just grabbed the same request URL that my code builds:
https://api.seatgeek.com/2/events?client_id=<my_client_id>&performers%5Bhome_team%5D.id=26&datetime_utc.gte=2019-03-28&datetime_utc.lte=2019-10-30&venue.city=Cincinnati&per_page=100&format=json
When I click the link, I see
[1,11,22,31,17,16,32,0],"average_price":34,"lowest_price_good_deals":14,"median_price":27,"listing_count":130,"lowest_price":14,"highest_price":104},"title":"Milwaukee Brewers at Cincinnati Reds","announce_date":"2018-10-30T00:00:00","score":0.671,"access_method":{"employee_only":false,"created_at":"2017-04-05T15:06:32Z","method":"PDF417"},"announcements":{},"taxonomies":[{"name":"sports","parent_id":null,"id":1000000},{"name":"baseball","parent_id":1000000,"id":1010000},{"name":"mlb","parent_id":1010000,"id":1010100}],"type":"mlb","status":"normal","description":"","datetime_local":"2019-04-03
But when I build the schedule dict from the returned events, I'm losing the April 3rd game. 100% my code. I wonder if it has something to do with running it through the json builtin in the requests module.. got me thinking.
Will close the issue, looks to be my code.
thanks for you help and sorry to bother unnecessarily.
No worries, hope you figure it out!
Hi,
My companies building is right next to an MLB stadium and the parking garage is closed during day games or jacked up to event pricing.
I want to use the seatgeek API to get a list of all scheduled Red's day games that fall between Monday-Friday and occur between 9 AM and 4 PM in the afternoon and create an ics (iCal) calendar with the filtered day games schedule.
I'm not sure if my filter is incorrect or not but when calling a list of all Cincinnati Red's home games, filtering for day of the week and occurring between 9AM and 4PM, I get a list back thats missing at least 1, maybe more games when compared with the official MLB schedule for the Cincinnati Reds.
In the code below, I'm only getting all Cincinnati Reds that occur during the regular season in which the Reds are the home team and the venue city is Cincinnati (I've tried without the venue city argument, no change in results).
Code:
Formatted output from a python dict built from the filter events api call:
Notice this list is missing the following game:
https://www.mlb.com/reds/schedule/2019-04/list?homeGame=true&nightGame=false Apr 3 Wed | Reds vs.Brewers | 12:35 pm EDT
However, through the SeatGeek UI, I can see the game: https://seatgeek.com/brewers-at-reds-tickets/4-3-2019-cincinnati-ohio-great-american-ball-park/mlb/4609733
What am I doing wrong? I've poured over the documentation, tried changing the date range filter, adding a time to the datetime_utc flter, and several other things with no results. I compared my parsed calendar output to the MLB schedule for the Cincinnati Reds home games and there are several others missing as well.
Any help would be greatly appreciated.
Thanks!