|
| 1 | +Google services API in Python |
| 2 | +============================= |
| 3 | + |
| 4 | +Python sdk that allows extracting data from Google services via |
| 5 | +`OutScraper API <http://outscraper.com>`__. |
| 6 | + |
| 7 | +Installation |
| 8 | +------------ |
| 9 | + |
| 10 | +Python 3+ |
| 11 | + |
| 12 | +.. code:: bash |
| 13 | +
|
| 14 | + pip install google-services-api |
| 15 | +
|
| 16 | +`Link to the python package |
| 17 | +page <https://pypi.org/project/google-services-api/>`__ |
| 18 | + |
| 19 | +Quick start |
| 20 | +----------- |
| 21 | + |
| 22 | +.. code:: python |
| 23 | +
|
| 24 | + from outscraper import ApiClient |
| 25 | + api_cliet = ApiClient(api_key='SECRET_API_KEY') |
| 26 | + maps_result = api_cliet.google_maps_search('restaurants brooklyn usa') |
| 27 | + search_result = api_cliet.google_search('bitcoin') |
| 28 | +
|
| 29 | +Get business reviews |
| 30 | +-------------------- |
| 31 | + |
| 32 | +.. code:: python |
| 33 | +
|
| 34 | + from outscraper import ApiClient |
| 35 | + api_cliet = ApiClient(api_key='SECRET_API_KEY') |
| 36 | + business_with_reviews = api_cliet.google_maps_business_reviews( |
| 37 | + 'Memphis Seoul brooklyn usa', limit=100, language='en') |
| 38 | +
|
| 39 | +response: |
| 40 | + |
| 41 | +.. code:: json |
| 42 | +
|
| 43 | + { |
| 44 | + "name": "Memphis Seoul", |
| 45 | + "address": "569 Lincoln Pl, Brooklyn, NY 11238, \\u0421\\u043f\\u043e\\u043b\\u0443\\u0447\\u0435\\u043d\\u0456 \\u0428\\u0442\\u0430\\u0442\\u0438", |
| 46 | + "address_street": "569 Lincoln Pl", |
| 47 | + "address_borough": "\\u041a\\u0440\\u0430\\u0443\\u043d-\\u0413\\u0430\\u0439\\u0442\\u0441", |
| 48 | + "address_city": "Brooklyn", |
| 49 | + "time_zone": "America/New_York", |
| 50 | + "type": "\\u0420\\u0435\\u0441\\u0442\\u043e\\u0440\\u0430\\u043d", |
| 51 | + "types": "\\u0420\\u0435\\u0441\\u0442\\u043e\\u0440\\u0430\\u043d", |
| 52 | + "postal_code": "11238", |
| 53 | + "latitude": 40.6717258, |
| 54 | + "longitude": -73.9579098, |
| 55 | + "phone": "+1 347-349-2561", |
| 56 | + "rating": 3.9, |
| 57 | + "reviews": 32, |
| 58 | + "site": "http://www.getmemphisseoul.com/", |
| 59 | + "photos_count": 77, |
| 60 | + "google_id": "0x89c25bb5950fc305:0x330a88bf1482581d", |
| 61 | + "reviews_link": "https://www.google.com/search?q=Memphis+Seoul,+569+Lincoln+Pl,+Brooklyn,+NY+11238,+%D0%A1%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B5%D0%BD%D1%96+%D0%A8%D1%82%D0%B0%D1%82%D0%B8&ludocid=3677902399965648925#lrd=0x89c25bb5950fc305:0x330a88bf1482581d,1", |
| 62 | + "reviews_id": "3677902399965648925", |
| 63 | + "photo": "https://lh5.googleusercontent.com/p/X_6-QqMphC_ctqs3bHSqFg", |
| 64 | + "working_hours": "\\u0432\\u0456\\u0432\\u0442\\u043e\\u0440\\u043e\\u043a: 16:00\\u201322:00 | \\u0441\\u0435\\u0440\\u0435\\u0434\\u0430: 16:00\\u201322:00 | \\u0447\\u0435\\u0442\\u0432\\u0435\\u0440: 16:00\\u201322:00 | \\u043f\\u02bc\\u044f\\u0442\\u043d\\u0438\\u0446\\u044f: 16:00\\u201322:00 | \\u0441\\u0443\\u0431\\u043e\\u0442\\u0430: 16:00\\u201322:00 | \\u043d\\u0435\\u0434\\u0456\\u043b\\u044f: 16:00\\u201322:00 | \\u043f\\u043e\\u043d\\u0435\\u0434\\u0456\\u043b\\u043e\\u043a: 16:00\\u201322:00", |
| 65 | + "reviews_per_score": "1: 6, 2: 0, 3: 4, 4: 3, 5: 19", |
| 66 | + "verified": true, |
| 67 | + "reserving_table_link": null, |
| 68 | + "booking_appointment_link": null, |
| 69 | + "owner_id": "100347822687163365487", |
| 70 | + "owner_link": "https://www.google.com/maps/contrib/100347822687163365487", |
| 71 | + "reviews_data": [ |
| 72 | + { |
| 73 | + "google_id": "0x89c25bb5950fc305:0x330a88bf1482581d", |
| 74 | + "autor_link": "https://www.google.com/maps/contrib/112314095435657473333?hl=en-US", |
| 75 | + "autor_name": "Eliott Levy", |
| 76 | + "autor_id": "112314095435657473333", |
| 77 | + "review_text": "Very good local comfort fusion food ! \\nKimchi coleslaw !! Such an amazing idea !", |
| 78 | + "review_link": "https://www.google.com/maps/reviews/data=!4m5!14m4!1m3!1m2!1s112314095435657473333!2s0x0:0x330a88bf1482581d?hl=en-US", |
| 79 | + "review_rating": 5, |
| 80 | + "review_timestamp": 1560692128, |
| 81 | + "review_datetime_utc": "06/16/2019 13:35:28", |
| 82 | + "review_likes": null |
| 83 | + }, |
| 84 | + { |
| 85 | + "google_id": "0x89c25bb5950fc305:0x330a88bf1482581d", |
| 86 | + "autor_link": "https://www.google.com/maps/contrib/106144075337788507031?hl=en-US", |
| 87 | + "autor_name": "fenwar1", |
| 88 | + "autor_id": "106144075337788507031", |
| 89 | + "review_text": "Great wings with several kinds of hot sauce. The mac and cheese ramen is excellent.\\nUPDATE:\\nReturned later to try the meatloaf slider, a thick meaty slice topped with slaw and a fantastic sauce- delicious. \\nConsider me a regular.\\ud83d\\udc4d", |
| 90 | + "review_link": "https://www.google.com/maps/reviews/data=!4m5!14m4!1m3!1m2!1s106144075337788507031!2s0x0:0x330a88bf1482581d?hl=en-US", |
| 91 | + "review_rating": 5, |
| 92 | + "review_timestamp": 1571100055, |
| 93 | + "review_datetime_utc": "10/15/2019 00:40:55", |
| 94 | + "review_likes": null |
| 95 | + }, |
| 96 | + ... |
| 97 | + ] |
| 98 | + } |
| 99 | +
|
0 commit comments