Playfast - Lightning-Fast Google Play Store Scraper
Project description
Playfast โก
Lightning-Fast Google Play Store Scraper
Playfast is a high-performance Google Play Store scraper built with Rust + PyO3, delivering 5-10x faster performance with true parallel batch processing.
โจ Features
Play Store Scraping
- ๐ Blazingly Fast: Batch API is 5-10x faster than sequential
- โก True Parallel: Rust core completely releases GIL
- ๐ฆ Pure Rust: HTTP + parsing all in Rust for maximum performance
- ๐ Type Safe: Full Pydantic validation and type hints
- ๐พ Memory Efficient: Only 1.5 KB per app, linear scaling
- ๐ Multi-Country: 247 countries, 93 unique Play Stores
- ๐ฆ Batch API: High-level functions for easy parallel processing
APK Download (NEW!)
- โฌ๏ธ Direct Download: Download APKs directly from Google Play Store
- ๐ Smart Authentication: OAuth โ AAS token exchange with auto-retry
- ๐พ Credential Management: Save and reuse authentication tokens
- ๐ฏ Version Control: Download specific versions or latest
- โก Parallel Downloads: Efficient batch downloading with ThreadPoolExecutor
APK/DEX Analysis
- ๐ Entry Point Analysis: Identify Activities, Services, deeplink handlers
- ๐ Call Graph: Method-to-method relationship tracking
- ๐ WebView Flow: Track paths from entry points to WebView APIs
- ๐ Data Flow: Intent โ WebView.loadUrl() data tracking
- ๐ก๏ธ Security Analysis: Deeplink vulnerability detection
๐ Performance
Batch Processing makes bulk operations 5-10x faster through true Rust parallelism!
| Method | Time | Speedup |
|---|---|---|
| Batch API | ~3s | 6-8x ๐ |
| RustClient + ThreadPool | ~3-4s | 6-7x |
| AsyncClient (concurrent) | ~3-5s | 5-7x |
| Sequential | ~20-30s | 1x |
Benchmark: Fetching 3 apps across 3 countries (9 requests total)
๐ Quick Start
Installation
Using pip (traditional):
pip install playfast
Using uv (recommended - faster):
uv add playfast
Using poetry:
poetry add playfast
Option 1: Batch API (Recommended - Easiest & Fastest)
from playfast import fetch_apps
# Fetch multiple apps across countries (parallel!)
apps = fetch_apps(
app_ids=["com.spotify.music", "com.netflix.mediaclient"],
countries=["us", "kr", "jp"],
)
print(f"Fetched {len(apps)} apps in ~3 seconds!")
Option 2: RustClient (Maximum Performance)
from playfast import RustClient
client = RustClient()
# Get app information (GIL-free!)
app = client.get_app("com.spotify.music")
print(f"{app.title}: {app.score}โญ ({app.ratings:,} ratings)")
# Get reviews
reviews, next_token = client.get_reviews("com.spotify.music")
for review in reviews[:5]:
print(f"{review.user_name}: {review.score}โญ")
Option 3: AsyncClient (Easy Async)
import asyncio
from playfast import AsyncClient
async def main():
async with AsyncClient() as client:
app = await client.get_app("com.spotify.music")
print(f"{app.title}: {app.score}โญ")
asyncio.run(main())
Option 4: APK Download (NEW!)
from playfast import ApkDownloader
# First-time setup with OAuth token
downloader = ApkDownloader(
email="user@gmail.com", oauth_token="oauth2_4/..." # Get from Google embedded setup
)
downloader.login()
downloader.save_credentials("~/.playfast/credentials.json")
# Subsequent use - just load credentials
downloader = ApkDownloader.from_credentials("~/.playfast/credentials.json")
# Download APK
apk_path = downloader.download("com.instagram.android")
print(f"Downloaded to: {apk_path}")
# Download specific version
apk_path = downloader.download("com.whatsapp", version_code=450814)
Option 5: APK/DEX Analysis
from playfast import ApkAnalyzer
# High-level API
analyzer = ApkAnalyzer("app.apk")
manifest = analyzer.manifest
classes = analyzer.classes
print(f"Package: {manifest.package_name}")
print(f"Activities: {len(manifest.activities)}")
print(f"Classes: {len(classes)}")
# Advanced: WebView flow analysis (low-level API)
from playfast.core import analyze_webview_flows_from_apk
flows = analyze_webview_flows_from_apk("app.apk", max_depth=10)
for flow in flows:
print(f"{flow.entry_point} โ {flow.webview_method}")
if flow.is_deeplink_handler:
print(" โ ๏ธ DEEPLINK HANDLER")
Complete Workflow: Download โ Analyze
from playfast import ApkDownloader, ApkAnalyzer
# Download APK from Google Play
downloader = ApkDownloader.from_credentials("~/.playfast/credentials.json")
apk_path = downloader.download("com.instagram.android")
# Analyze the downloaded APK
analyzer = ApkAnalyzer(apk_path)
manifest = analyzer.manifest
print(f"๐ฆ {manifest.package_name}")
print(f"๐ข Version: {manifest.version_name} ({manifest.version_code})")
print(f"๐ฑ Activities: {len(manifest.activities)}")
print(f"๐ Permissions: {len(manifest.permissions)}")
๐ Examples
See the examples/ directory for more:
Play Store Scraping
01_async_client.py- AsyncClient basics02_rust_client.py- RustClient for max performance03_batch_api.py- High-level batch API04_countries_and_categories.py- Country optimization
APK Download
download/auth_setup.py- Interactive authentication setupdownload/download_apk.py- Download APKs with CLIdownload/batch_download.py- Parallel batch downloading
APK/DEX Analysis
apk/basic.py- ApkAnalyzer high-level APIapk/entry_point_demo.py- Entry point & deeplink detectionapk/call_graph_demo.py- Method call relationship analysisapk/security_audit.py- Security auditwebview/flow_demo.py- Complete WebView flow analysiswebview/high_level_api.py- High-level ApkAnalyzer API
๐ Documentation
Play Store Scraping
- Getting Started - Installation and first steps
- Quick Start - Practical examples
- API Reference - Complete API documentation
- Batch API Guide - Batch processing guide
APK Download
- APK Download Implementation - Architecture and design
- Authentication: Get OAuth token from Google Embedded Setup
APK/DEX Analysis
- WebView Flow Analysis - Complete guide to WebView security analysis
- Rust Core API - Low-level API usage guide
๐๏ธ Architecture
Playfast uses pure Rust for maximum performance:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Python High-level API โ
โ - ApkDownloader (APK download) โ
โ - ApkAnalyzer (APK/DEX analysis) โ
โ - Batch API (Play Store scraping) โ
โ - RustClient / AsyncClient โ
โ - Pydantic Models โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PyO3 Bindings
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Rust Core (playfast.core) โ
โ - Google Play API (gpapi - APK download) โ
โ - HTTP Client (reqwest) โ
โ - HTML Parser (scraper) โ
โ - DEX Parser (custom) โ
โ - Parallel Processing (rayon + tokio) โ
โ - Complete GIL Release โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
API Layers
| Layer | Components | Use Case |
|---|---|---|
| High-level | ApkDownloader, ApkAnalyzer, Batch API |
General users (90% of use cases) |
| Mid-level | RustClient, AsyncClient |
Direct scraping control |
| Low-level | playfast.core.* |
Security research, advanced analysis |
Client Options for Play Store Scraping
| Method | Speed | Ease | Best For |
|---|---|---|---|
| Batch API | โกโกโก | โญโญโญ | Multiple items |
| RustClient | โกโกโก | โญโญ | Single items |
| AsyncClient | โกโก | โญโญ | Async code |
๐ Multi-Country Optimization
Playfast optimizes global data collection:
from playfast import get_unique_countries, get_representative_country
# Instead of 247 countries, use 93 unique stores (2.7x faster!)
unique = get_unique_countries() # 93 unique Play Stores
# Get representative for any country
rep = get_representative_country(
"fi"
) # Finland โ Vanuatu store (shared by 138 countries)
๐ง Development
# Clone repository
git clone https://github.com/taeyun16/playfast.git
cd playfast
# Install dependencies
uv sync
# Build Rust extension
uv run maturin develop --release
# Run tests
uv run pytest
# Run examples
uv run python examples/basic.py
# Run benchmarks
uv run python benchmarks/batch_apps_benchmark.py
See Development Setup for detailed instructions.
๐ค Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
๐ License
MIT License - see LICENSE for details.
๐ Acknowledgments
- Built with PyO3 (Rust-Python bindings)
- Inspired by google-play-scraper
- APK Download: gpapi by EFF
- HTTP: reqwest
- Parsing: scraper
- Async Runtime: tokio
โ ๏ธ Disclaimer
This tool is for educational and research purposes only. Please respect Google Play Store's Terms of Service. Use responsibly with appropriate rate limiting.
Made with โค๏ธ using Rust + Python
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file playfast-0.5.9.tar.gz.
File metadata
- Download URL: playfast-0.5.9.tar.gz
- Upload date:
- Size: 424.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e013e91f70d669eaa237205479a327b62ed8f2a5ac808ab24107087c19c62898
|
|
| MD5 |
1899d76d04b492690a608da45faa9e96
|
|
| BLAKE2b-256 |
67c7acac0d859dfab1a6508610517c892ee4c75db4e5dd811a17e0554329da6b
|
File details
Details for the file playfast-0.5.9-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: playfast-0.5.9-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd6d3b83fd252f00255933b108661c2dfec85c95b09a578a9f6d041f0b793d63
|
|
| MD5 |
0d1a8b0438da7aacec87dee96c973fa0
|
|
| BLAKE2b-256 |
456cbd437ced69c790f9900bca10ff71b4fb0536ebb2443afe32459eeafcc597
|
File details
Details for the file playfast-0.5.9-cp311-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: playfast-0.5.9-cp311-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.7 MB
- Tags: CPython 3.11+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
356ad0698c1c4f15059428f2e93fa5861c3e02a1469604ea939bd159e2b19e8e
|
|
| MD5 |
bcb43b501556eefbd55c7920378362c7
|
|
| BLAKE2b-256 |
1e30e686e3b1759a1d47f1306d8f079eded130d71f32c5cdb379adc9285dde36
|
File details
Details for the file playfast-0.5.9-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: playfast-0.5.9-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b4872edb57af9952b6611d3e01e8c00d3a0578ef99556cda1afa55b1941b4de
|
|
| MD5 |
1d6383892bb9d557638fb6fda860de74
|
|
| BLAKE2b-256 |
e39b3e926be4619ce6089b8a7dcbac54dccd310cf41995a3807d9a9957f63669
|
File details
Details for the file playfast-0.5.9-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: playfast-0.5.9-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ca42002acdade282f1a4f2ffc136fbfcf4bb719f169561bdefa39b31197593
|
|
| MD5 |
a9add1a19a596f922d2afbac06dcdab1
|
|
| BLAKE2b-256 |
73b42f16be70d60271203c6bf0ca5b2aa290dee18df35e0ee9ec63d17188c4df
|