outscraper / outscraper-python

The library provides convenient access to the Outscraper API from applications written in the Python language. Allows using Outscraper's services from your code.
https://outscraper.com
MIT License
69 stars 18 forks source link

Add option to enable and disable async and sync API flow #6

Closed lalitpagaria closed 1 year ago

lalitpagaria commented 3 years ago

Currently this SDK is calling API in async way, but adding loop till it receive update or max ttl expire. While integrating this SDK with Obsei, I faced python thread getting chocked. So I used direct API call - https://github.com/obsei/obsei/blob/master/obsei/source/google_maps_reviews.py

Ideally requests itself support timeout, so better to call API in sync fashion. And if user interested in async call then better to call second api via requests even hook. Which use can pass the custom function to handle the output. This way main thread will not be blocked for the call.

This is just enhancement request. I just suggested to improve it :)

vlad-stack commented 1 year ago

Thank you for the request! We're moving toward fast API responses. With the new version of google_maps_reviews you can call the API with async=flase if the response time is expected to be fast and async=true if it's expected that the amount of reviews is going to be big (more than 1000 reviews).

Could you please try it and let me know if it helps?

Alternatively, we've added support for webhooks: https://app.outscraper.com/integrations So probably we'll add the ability to force async=true so you can call the API and the results will be returned to your webhook. Please let me know if this is what you are looking for.

lalitpagaria commented 1 year ago

Thank you @vlad-stack I have already moved to v3 API. In fact, started using in production our SaaS solution https://oraika.com Hopefully, we will get enough traffic and increase our collaboration.

For now closing this.