Upload google_play_scraper/features/collections.py
Browse files
google_play_scraper/features/collections.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Extract collections (Top Charts, Featured, etc.)."""
|
| 2 |
+
from typing import List, Dict
|
| 3 |
+
from google_play_scraper.utils.http_utils import get
|
| 4 |
+
from google_play_scraper.constants.google_play import COLLECTION_URL_FORMAT
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def collections(collection: str = "topselling_free", lang: str = "en", country: str = "us", n_items: int = 50) -> List[Dict]:
|
| 8 |
+
"""Get apps from a collection."""
|
| 9 |
+
url = COLLECTION_URL_FORMAT.format(collection=collection, lang=lang, country=country, n_items=n_items)
|
| 10 |
+
response = get(url)
|
| 11 |
+
|
| 12 |
+
return response.get("apps", [])
|