Skip to main content

VastCap Python SDK

Project description

vastcap-python

A fast, minimal, and easy-to-use Python wrapper for the Vast Captcha API, supporting both asynchronous and synchronous solving!

✨ Features

  • ✅ Supports ReCaptcha v2 and hCaptcha tasks
  • ✅ Easy solve() method with built-in polling
  • ✅ Typed error handling & result objects
  • ✅ Tiny, no-bloat dependency footprint

📦 Installation

pip install vastcap

🔐 Authentication

Pass your API key via Vast(api_key=...) or AsyncVast(api_key=...).


🧪 Example Usage

Synchronous

from vastcap import (
    Vast,
    TurnstileTask
)

def main() -> None:
    client = Vast(api_key="vastCap_...")
    
    task = TurnstileTask(
        website_url="...",
        website_key="...",
    )
    
    solution: str = client.solve(task)
    print(f"Response token: {solution.turnstile_response}")
    
    balance: int | float = client.get_balance()
    print(f"Current balance: ${balance:.2f}")
  
if __name__ == "__main__":
    main()

Asynchronous

from vastcap import AsyncVast, HCaptchaTask
import asyncio

async def main() -> None:
    async with AsyncVast(api_key="vastCap_...") as client:
        task = HCaptchaTask(
            website_url="https://discord.com/register",
            website_key="a9b5fb07-92ff-493f-86fe-352a2803b3df",
            enterprise=True,
            is_invisible=True,
            proxy="user:pass@ip:port"
        )
    
        solution: str = await client.solve(task)
        print(f"Response token: {solution.hcaptcha_response}")
    
        balance: int | float = await client.get_balance()
        print(f"Current balance: ${balance:.2f}")

if __name__ == "__main__":
    asyncio.run(main())

🧩 Task Types

from vastcap import TaskType
  • RecaptchaV2Task
  • RecaptchaV3Task
  • HCaptchaTask
  • TurnstileTask
  • FunCaptchaTask

Each task must define:

  • website_url: the page with the captcha
  • website_key: the sitekey for the captcha provider
  • (Optional) task-specific flags like is_invisible

💥 Errors

All errors are derived from VastCapException, but you can catch more specific errors and handle them as you please. You can find more information about these errors in the API docs.

from vastcap import VastCapException # broad
from vastcap import InvalidAPIKeyError # specific to api key error

Check status, errorCode, and errorDescription in API docs or via raised exceptions.

Docs: https://docs.vast.sh


🧱 Structure

  • client.py – Sync & Async client classes
  • types.py – Typed definitions for tasks, results, statuses
  • exceptions.py – Custom exception mapping
  • examples/ – Working usage examples

🛠️ Contributing

PRs and issues welcome!

git clone https://github.com/vastien/vastcap-python
cd vastcap-python
pip install -e .[dev]

⚖ License

License

Copyright © 2025 vastien

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

vastcap-1.0.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

vastcap-1.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file vastcap-1.0.1.tar.gz.

File metadata

  • Download URL: vastcap-1.0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vastcap-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7a22ebb62f4f0e32412026d1cdd60b4130f6e97848197ef0a80fe828b74407d9
MD5 6c7fd2d0f712c2250f69bd0a6d202edd
BLAKE2b-256 48b26f4bb63f9a89f7db1c8f2a14930504a0867969559e20236ca7ecc2a061d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for vastcap-1.0.1.tar.gz:

Publisher: workflow.yml on vastien/vastcap-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vastcap-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: vastcap-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vastcap-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dba1a58fcf17eb313b1039dceae8460a95651125b041d99caf707ee405878798
MD5 f44fb4fd7fc2a4e98b36984a18c98bff
BLAKE2b-256 a51182234286597605fecfacac2bc7ea8bd8176596bc35bb9c37040fd8a39a77

See more details on using hashes here.

Provenance

The following attestation bundles were made for vastcap-1.0.1-py3-none-any.whl:

Publisher: workflow.yml on vastien/vastcap-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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