Hi, happy new year ! I have a question about the patterns API. I know the response comes back with the latest month’s data, but I’m wondering if there’s a search filter I can add to query past year+month/week’s data? thanks in advance!
This topic was automatically generated from Slack. You can find the original thread here.
@vchen quick question, does the safegraph client’s search function have start_date end_date parameters? I see a “date” parameter, but it would be nice if I could plug in the start_date end_dates directly.
To give some context, I’m doing COVID research comparing business activity in the NYC metro area from 2018 - 2021. So I want to be able to search for all the places in NYC (or all the places within a list of predefined zipcodes) between march 2018 and 2021 and get the raw_visitor_count column. Thanks!
@vchen I’m also realizing the date filter only retrieves one week even if the start_date and end_date contains multiple weeks. Is this working as intended?
here’s my query and i’ve attached a screenshot of my table which shows the start_date_range and end_date_range to not match my query.
the python library is currently running on v1 of our api. we are working to upgrade it to v2 to be able to use the date_start and date_end.
yup, we are providing weekly data for each week individually. we leave it like that so you can normalize the patterns data and aggregate it for arbitrary time periods based on your methodology.
we are always working on improving the experience with the api though, how would you want the data to be returned? (just normalized and sum-ed visit counts? any other fields like home cbgs? etc.)
I think the API usage for search’s start_date end_date fields is a bit confusing since I expected the API to return all of the raw_visit_counts within the start_date and end_date range. If the use case (get the first week within the start and end date rage) can’t be changed, perhaps add documentation for the API specifically to clarify this.
For my use case specifically, it would be ideal to be returned normalized and summed visit counts based on the start_date and end_date filters (for instance, I want to see all the raw_visit_counts to a specific McDonald’s between 11-01-2021 and 12-31-2021).
Since this isn’t supported yet, would you recommend me to iterate through all the weeks I’m looking for and sum the raw_visit_counts myself?
@vchen Hello, I am running into a similar issue and wondered if this has been resolved in the python library yet? One of my use cases is trying to grab the foot traffic to casinos (by state) going back many months. Is this possible using the api in Python?
the best solution would be to run the query from graphql directly for now. also, if you are tryin get monthly data, we just added a new field to help here
@vchen Thank you, I think that is exactly what I need. However, when running the same commands this morning as were run last night every request, both through requests and sgql.HTTP_Client are returning a 408 error without any data. I have tried changing the api key, copying the code once again from what you wrote, and nothing is producing any data.