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
RecaptchaV2TaskRecaptchaV3TaskHCaptchaTaskTurnstileTaskFunCaptchaTask
Each task must define:
website_url: the page with the captchawebsite_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 classestypes.py– Typed definitions for tasks, results, statusesexceptions.py– Custom exception mappingexamples/– Working usage examples
🛠️ Contributing
PRs and issues welcome!
git clone https://github.com/vastien/vastcap-python
cd vastcap-python
pip install -e .[dev]
⚖ License
Copyright © 2025 vastien
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a22ebb62f4f0e32412026d1cdd60b4130f6e97848197ef0a80fe828b74407d9
|
|
| MD5 |
6c7fd2d0f712c2250f69bd0a6d202edd
|
|
| BLAKE2b-256 |
48b26f4bb63f9a89f7db1c8f2a14930504a0867969559e20236ca7ecc2a061d7
|
Provenance
The following attestation bundles were made for vastcap-1.0.1.tar.gz:
Publisher:
workflow.yml on vastien/vastcap-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vastcap-1.0.1.tar.gz -
Subject digest:
7a22ebb62f4f0e32412026d1cdd60b4130f6e97848197ef0a80fe828b74407d9 - Sigstore transparency entry: 233606205
- Sigstore integration time:
-
Permalink:
vastien/vastcap-python@2a5c706daaf30ecfa8b88986ba54455e2bec7a95 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/vastien
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@2a5c706daaf30ecfa8b88986ba54455e2bec7a95 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dba1a58fcf17eb313b1039dceae8460a95651125b041d99caf707ee405878798
|
|
| MD5 |
f44fb4fd7fc2a4e98b36984a18c98bff
|
|
| BLAKE2b-256 |
a51182234286597605fecfacac2bc7ea8bd8176596bc35bb9c37040fd8a39a77
|
Provenance
The following attestation bundles were made for vastcap-1.0.1-py3-none-any.whl:
Publisher:
workflow.yml on vastien/vastcap-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vastcap-1.0.1-py3-none-any.whl -
Subject digest:
dba1a58fcf17eb313b1039dceae8460a95651125b041d99caf707ee405878798 - Sigstore transparency entry: 233606206
- Sigstore integration time:
-
Permalink:
vastien/vastcap-python@2a5c706daaf30ecfa8b88986ba54455e2bec7a95 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/vastien
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@2a5c706daaf30ecfa8b88986ba54455e2bec7a95 -
Trigger Event:
push
-
Statement type: