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/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/mixL1nk/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.2.tar.gz (435.6 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.2-cp311-abi3-win_amd64.whl (4.1 MB view details)

Uploaded CPython 3.11+Windows x86-64

playfast-0.5.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.1 MB view details)

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

playfast-0.5.2-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.2.tar.gz.

File metadata

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

File hashes

Hashes for playfast-0.5.2.tar.gz
Algorithm Hash digest
SHA256 1c840ed1fa1c58c1450cb320a566e581dd7f7774297e24b07931d8ec96811104
MD5 68a70ba6d10fe5b5200fd03f48878d54
BLAKE2b-256 fdc84abdc53ab94782902b33287dbfb10c412322e153c701452db5b78a4bd00d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: playfast-0.5.2-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for playfast-0.5.2-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 02607d3e1436970544c58c61ab7819d36e132c914f2c3ba8514d366af3c36a6b
MD5 650accd9aa1205ba0650c13615c0549d
BLAKE2b-256 a77c444698ddc94e560729bd1548aa64c74c59a6de6a7e72d8cbc31f59b16c77

See more details on using hashes here.

File details

Details for the file playfast-0.5.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for playfast-0.5.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aaf166b0c6bb5d20a4e9c72e9eaba5a729db71cc41b47f71f3d42c5329149b31
MD5 89b1a61e09ef1366f1357ec82837f16f
BLAKE2b-256 b940c050b2f0bad0edba3729518a2abbf000d6e87e1a13b02bbb877d2f167ed4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for playfast-0.5.2-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f8e13799880b17f4ad4ea9f343ea5baf7615a5612f93f5c1ad185c948a2af4ed
MD5 2611c9840d0c74d0597ddec7acd67347
BLAKE2b-256 5235464c18b621c426129d1e8b73b79dd6537d06ed2c5d9d97cdccdcb396d47a

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