mirror of
https://github.com/FliegendeWurst/googleplay-api.git
synced 2024-11-22 12:54:58 +00:00
Added API to fetch search suggestions
This commit is contained in:
parent
2247d2386e
commit
9a9ba1434a
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ build/
|
|||||||
dist/
|
dist/
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
.idea/
|
.idea/
|
||||||
|
.venv/
|
||||||
|
@ -300,6 +300,17 @@ class GooglePlayAPI(object):
|
|||||||
|
|
||||||
return message
|
return message
|
||||||
|
|
||||||
|
def searchSuggest(self, query):
|
||||||
|
params = {"c": "3",
|
||||||
|
"q": requests.utils.quote(query),
|
||||||
|
"ssis": "120",
|
||||||
|
"sst": "2"}
|
||||||
|
data = self.executeRequestApi2("searchSuggest", params=params)
|
||||||
|
response = data.payload.searchSuggestResponse
|
||||||
|
return [{"type": e.type,
|
||||||
|
"suggestedQuery": e.suggestedQuery,
|
||||||
|
"title": e.title} for e in response.entry]
|
||||||
|
|
||||||
def search(self, query, nb_result, offset=None):
|
def search(self, query, nb_result, offset=None):
|
||||||
""" Search the play store for an app.
|
""" Search the play store for an app.
|
||||||
|
|
||||||
|
3
test.py
3
test.py
@ -26,6 +26,9 @@ server.login(None, None, gsfId, authSubToken)
|
|||||||
|
|
||||||
apps = server.search('telegram', 34, None)
|
apps = server.search('telegram', 34, None)
|
||||||
|
|
||||||
|
print('\nSearch suggestion for "fir"\n')
|
||||||
|
print(server.searchSuggest('fir'))
|
||||||
|
|
||||||
print('nb_result: 34')
|
print('nb_result: 34')
|
||||||
print('number of results: %d' % len(apps))
|
print('number of results: %d' % len(apps))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user