Closed Almaroo closed 1 day ago
[{'street': 'Bożego Ciała 12 ½', 'latitude': 50.051604, 'phone': '+48 513 600 538', 'longitude': 19.9435629, 'name': 'William Rabbit & Co', 'query': 'bar, Kraków, Polska', 'business_status': 'OPERATIONAL', 'working_hours': {'poniedziałek': '18:00-00:00', 'wtorek': '18:00-00:00', 'środa': '18:00-00:00', 'czwartek': '18:00-01:00', 'piątek': '18:00-02:00', 'sobota': '18:00-02:00', 'niedziela': '18:00-00:00'}, 'city': 'Kraków', 'place_id': 'ChIJLz9MRlJbFkcRaMvKYMQJNCc', 'postal_code': '31-059'}]
this is the response I get when I call the endpoint
YOUR_API_KEY = 'API_KEY'
from outscraper import ApiClient
api_client = ApiClient(api_key=YOUR_API_KEY)
scraped_fields = [
"query",
"place_id",
"name",
"latitude",
"longitude",
"street",
"city",
"postal_code",
"phone",
"email",
"working_hours",
"business_status",
]
r = api_client.google_maps_search(
query='bar, Kraków, Polska',
language='PL',
limit=500,
fields=scraped_fields,
async_request=False,
drop_duplicates=True
)
print(r)
I cannot reproduce the problem, please give it another try
ok, I see when I omit indexer [0]
it indeed looks fine. Im unsure why it was there in the first place in our codebase but it for sure worked before :D Ill double check it within my team, thanks a lot
Ok figured it out, we didnt use drop_duplicates = True
from start and result was a nested list, thats why [0]
was used. When called with this flag response seems to be flattened.
Edit:
Just like your docs say
drop_duplicates (bool): parameter specifies whether the bot will drop the same organizations from different queries. Using the parameter combines results from each query inside one big array.
Affected versions: 5.1.0, 5.3.3
Tldr: Google Maps response schema changed/is broken? Description: Around yesterday I noticed that client started malfunctioning. Im calling my function in the following manenr:
Prior to circa yesterday the result of calling this for query:
bar, Kraków, Polska
was something like this:However yesterday when I ran client I was a little bit surprised to see that result of this call now looks like this:
Should you need any further details from me please let me know - Ill be happy to help you.
EDIT: I noticed that I was running package being 2 minor versions late. I bumped it to the latest but unfortunately no luck.
Best regards,