seatgeek / api-support

A support channel for the SeatGeek Platform
9 stars 10 forks source link

Datetime_utc argument won't work with some cities when calling the events endpoint #69

Closed nikarc closed 6 years ago

nikarc commented 6 years ago

Hi guys,

I'm calling the /events endpoint and, for some cities, including the datetime_utc query will cause the endpoint to return an empty array.

Here is an example with Brooklyn as the city which works correctly:

https://api.seatgeek.com/2/events?venue.city=brooklyn&datetime_utc=2018-08-06&taxonomies.name=concert&per_page=5

But when I try San Francisco as the city:

https://api.seatgeek.com/2/events?venue.city=san%20francisco&datetime_utc=2018-08-06&taxonomies.name=concert&per_page=5

I get an empty array for the events attribute:

{
    "events": [],
    "meta": {
        "total": 0,
        "took": 2,
        "per_page": 5,
        "geolocation": null,
        "page": 1
    }
}

If I try the San Francisco url without the datetime_utc query, i get a a full list of events, some of which are on 2018-08-06, so I'm not sure why they wouldn't be included when called with the datetime_utc query

Thanks

chrisvoll commented 6 years ago

@nikarc The datetime_utc and datetime_local parameters only work with full datetimes, so 2018-08-06 is interpreted as 2018-08-06T00:00:00. Using .gte and .lte should work for your use case:

https://api.seatgeek.com/2/events?venue.city=san%20francisco&datetime_utc.gte=2018-08-06T00:00:00&datetime_utc.lte=2018-08-06T23:59:59&taxonomies.name=concert&per_page=5

nikarc commented 6 years ago

Ahh ok, thanks @chrisvoll !