Hello, we are trying to use Search By Radius to get locations around a set of coordinates. We are using R to pass the following query, but when we do, we get a 400 error. When we run the same query in the GUI here, it works. Anyone can help us figure out what’s going wrong? Thank you!
That works fine when I send that query through the API in R. I get a valid response. But when I send that exact same query through the GraphiQL GUI at the bottom of the page, I get this error
{
"error": "Query does not pass validation. Violations:\n\nUnknown argument 'first' on field 'search' of type 'Query'. (line 2, column 10):\n search(first: 5 filter: { \n ^\n\nCannot query field 'placekey' on type 'SearchResult'. Did you mean 'places'? (line 8, column 5):\n placekey\n ^\n\nCannot query field 'safegraph_core' on type 'SearchResult'. (line 9, column 5):\n safegraph_core {\n ^"
}
Thanks! We were trying to implement the same code in Python (Search By Radius) and were wondering how we could pass in multiple attributes — latitude, longitude and distanceInMeters.
We tried using the Python structure that’s on this page, but we get an error
typeError: search() got an unexpected keyword argument 'latitude'
hi aadit, the python library sgql is on v1 on the api and is going to be deprecated since we’ve been making a lot of improvements to v2 of the api. you can make that request directly in python with requests , here is an example: https://safegraph.dev/core/store-locator/