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.9.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.9-cp311-abi3-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

playfast-0.5.9-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.9-cp311-abi3-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

playfast-0.5.9-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.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

Hashes for playfast-0.5.9.tar.gz
Algorithm Hash digest
SHA256 e013e91f70d669eaa237205479a327b62ed8f2a5ac808ab24107087c19c62898
MD5 1899d76d04b492690a608da45faa9e96
BLAKE2b-256 67c7acac0d859dfab1a6508610517c892ee4c75db4e5dd811a17e0554329da6b

See more details on using hashes here.

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

Hashes for playfast-0.5.9-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 cd6d3b83fd252f00255933b108661c2dfec85c95b09a578a9f6d041f0b793d63
MD5 0d1a8b0438da7aacec87dee96c973fa0
BLAKE2b-256 456cbd437ced69c790f9900bca10ff71b4fb0536ebb2443afe32459eeafcc597

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for playfast-0.5.9-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 356ad0698c1c4f15059428f2e93fa5861c3e02a1469604ea939bd159e2b19e8e
MD5 bcb43b501556eefbd55c7920378362c7
BLAKE2b-256 1e30e686e3b1759a1d47f1306d8f079eded130d71f32c5cdb379adc9285dde36

See more details on using hashes here.

File details

Details for the file playfast-0.5.9-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for playfast-0.5.9-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b4872edb57af9952b6611d3e01e8c00d3a0578ef99556cda1afa55b1941b4de
MD5 1d6383892bb9d557638fb6fda860de74
BLAKE2b-256 e39b3e926be4619ce6089b8a7dcbac54dccd310cf41995a3807d9a9957f63669

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for playfast-0.5.9-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 23ca42002acdade282f1a4f2ffc136fbfcf4bb719f169561bdefa39b31197593
MD5 a9add1a19a596f922d2afbac06dcdab1
BLAKE2b-256 73b42f16be70d60271203c6bf0ca5b2aa290dee18df35e0ee9ec63d17188c4df

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