Skip to content

Commit f53cf53

Browse files
author
vlad
committed
first commit
0 parents  commit f53cf53

File tree

7 files changed

+450
-0
lines changed

7 files changed

+450
-0
lines changed

.gitignore

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# IPython
79+
profile_default/
80+
ipython_config.py
81+
82+
# pyenv
83+
.python-version
84+
85+
# celery beat schedule file
86+
celerybeat-schedule
87+
88+
# SageMath parsed files
89+
*.sage.py
90+
91+
# Environments
92+
.env
93+
.venv
94+
env/
95+
venv/
96+
ENV/
97+
env.bak/
98+
venv.bak/
99+
100+
# Spyder project settings
101+
.spyderproject
102+
.spyproject
103+
104+
# Rope project settings
105+
.ropeproject
106+
107+
# mkdocs documentation
108+
/site
109+
110+
# mypy
111+
.mypy_cache/
112+
.dmypy.json
113+
dmypy.json
114+
115+
# Pyre type checker
116+
.pyre/
117+
118+
.idea/*
119+
.idea/*
120+
.vscode/*
121+
.DS_Store
122+
test.py
123+
deploy.sh

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 OutScraper.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Google services API in Python
2+
Python sdk that allows extracting data from Google services via [OutScraper API](http://outscraper.com).
3+
4+
## Installation
5+
6+
Python 3+
7+
```bash
8+
pip install google-services-api
9+
```
10+
11+
[Link to the python package page](https://pypi.org/project/google-services-api/)
12+
13+
## Quick start
14+
15+
```python
16+
from outscraper import ApiClient
17+
api_cliet = ApiClient(api_key='SECRET_API_KEY')
18+
maps_result = api_cliet.google_maps_search('restaurants brooklyn usa')
19+
search_result = api_cliet.google_search('bitcoin')
20+
```
21+
22+
## Get business reviews
23+
24+
```python
25+
from outscraper import ApiClient
26+
api_cliet = ApiClient(api_key='SECRET_API_KEY')
27+
business_with_reviews = api_cliet.google_maps_business_reviews(
28+
'Memphis Seoul brooklyn usa', limit=100, language='en')
29+
```
30+
31+
response:
32+
```json
33+
{
34+
"name": "Memphis Seoul",
35+
"address": "569 Lincoln Pl, Brooklyn, NY 11238, \\u0421\\u043f\\u043e\\u043b\\u0443\\u0447\\u0435\\u043d\\u0456 \\u0428\\u0442\\u0430\\u0442\\u0438",
36+
"address_street": "569 Lincoln Pl",
37+
"address_borough": "\\u041a\\u0440\\u0430\\u0443\\u043d-\\u0413\\u0430\\u0439\\u0442\\u0441",
38+
"address_city": "Brooklyn",
39+
"time_zone": "America/New_York",
40+
"type": "\\u0420\\u0435\\u0441\\u0442\\u043e\\u0440\\u0430\\u043d",
41+
"types": "\\u0420\\u0435\\u0441\\u0442\\u043e\\u0440\\u0430\\u043d",
42+
"postal_code": "11238",
43+
"latitude": 40.6717258,
44+
"longitude": -73.9579098,
45+
"phone": "+1 347-349-2561",
46+
"rating": 3.9,
47+
"reviews": 32,
48+
"site": "http://www.getmemphisseoul.com/",
49+
"photos_count": 77,
50+
"google_id": "0x89c25bb5950fc305:0x330a88bf1482581d",
51+
"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",
52+
"reviews_id": "3677902399965648925",
53+
"photo": "https://lh5.googleusercontent.com/p/X_6-QqMphC_ctqs3bHSqFg",
54+
"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",
55+
"reviews_per_score": "1: 6, 2: 0, 3: 4, 4: 3, 5: 19",
56+
"verified": true,
57+
"reserving_table_link": null,
58+
"booking_appointment_link": null,
59+
"owner_id": "100347822687163365487",
60+
"owner_link": "https://www.google.com/maps/contrib/100347822687163365487",
61+
"reviews_data": [
62+
{
63+
"google_id": "0x89c25bb5950fc305:0x330a88bf1482581d",
64+
"autor_link": "https://www.google.com/maps/contrib/112314095435657473333?hl=en-US",
65+
"autor_name": "Eliott Levy",
66+
"autor_id": "112314095435657473333",
67+
"review_text": "Very good local comfort fusion food ! \\nKimchi coleslaw !! Such an amazing idea !",
68+
"review_link": "https://www.google.com/maps/reviews/data=!4m5!14m4!1m3!1m2!1s112314095435657473333!2s0x0:0x330a88bf1482581d?hl=en-US",
69+
"review_rating": 5,
70+
"review_timestamp": 1560692128,
71+
"review_datetime_utc": "06/16/2019 13:35:28",
72+
"review_likes": null
73+
},
74+
{
75+
"google_id": "0x89c25bb5950fc305:0x330a88bf1482581d",
76+
"autor_link": "https://www.google.com/maps/contrib/106144075337788507031?hl=en-US",
77+
"autor_name": "fenwar1",
78+
"autor_id": "106144075337788507031",
79+
"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",
80+
"review_link": "https://www.google.com/maps/reviews/data=!4m5!14m4!1m3!1m2!1s106144075337788507031!2s0x0:0x330a88bf1482581d?hl=en-US",
81+
"review_rating": 5,
82+
"review_timestamp": 1571100055,
83+
"review_datetime_utc": "10/15/2019 00:40:55",
84+
"review_likes": null
85+
},
86+
...
87+
]
88+
}
89+
```

README.rst

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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+

outscraper/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from outscraper.api_client import *

0 commit comments

Comments
 (0)