Skip to main content

Playfast - Lightning-Fast Google Play Store Scraper

Project description

Playfast โšก

Lightning-Fast Google Play Store Scraper

License: MIT Python 3.11+ Built with Rust CI Coverage PyPI Documentation

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

APK Download

APK/DEX Analysis

๐Ÿ“– Documentation

Play Store Scraping

APK Download

  • APK Download Implementation - Architecture and design
  • Authentication: Get OAuth token from Google Embedded Setup

APK/DEX Analysis

๐Ÿ—๏ธ 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:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“ License

MIT License - see LICENSE for details.

๐Ÿ™ Acknowledgments

โš ๏ธ 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

playfast-0.5.8.tar.gz (424.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

playfast-0.5.8-cp311-abi3-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

playfast-0.5.8-cp311-abi3-manylinux_2_28_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

playfast-0.5.8-cp311-abi3-macosx_10_12_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file playfast-0.5.8.tar.gz.

File metadata

  • Download URL: playfast-0.5.8.tar.gz
  • Upload date:
  • Size: 424.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for playfast-0.5.8.tar.gz
Algorithm Hash digest
SHA256 912eed3eaff6e2de7d5a8541780b16c29aa68f5b6d787383d7218266670c90d0
MD5 5e32fcd24a78199db7209369dc22b8a2
BLAKE2b-256 be646a7170dbea4a624269699f4cbb18209cb6f44102a2f753aab78d23418049

See more details on using hashes here.

File details

Details for the file playfast-0.5.8-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: playfast-0.5.8-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

Hashes for playfast-0.5.8-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 92a43df1ee4fd9e56afca144015167e6359b860a7f135b4c8023622398039fdf
MD5 fd531f811714366e6e52ee0b9547bd7f
BLAKE2b-256 7f18b1bb464ccdf5f53690fb4fee78eac7590f7e2a1617d0456ba557c849d88b

See more details on using hashes here.

File details

Details for the file playfast-0.5.8-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for playfast-0.5.8-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 edc8f3e6862fd318cebbf235b23f8fb02cd54e24b3826b787a04adcf9da9ca94
MD5 d799c393f8b07f7e7486165148fe55c1
BLAKE2b-256 46aad00e9f76c5f9ddba51a867a54352e35a5f7ec2a89db330d9cafff1b8ad4a

See more details on using hashes here.

File details

Details for the file playfast-0.5.8-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for playfast-0.5.8-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0982c07c2a252b5ecfd560b9f4c3462792988132aa4182fd9f2d51d1bf710063
MD5 0d24622253bd40c47196f8784f80bc8d
BLAKE2b-256 e5f1a0d47254d765beab39dc22db5d0c2b5a2b0b0d677bad2bfbf16f68f41902

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page