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
Release files for vastcap 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vastcap-1.0.1.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vastcap-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / vastcap-1.0.1.tar.gz
| Download URL | vastcap-1.0.1.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a22ebb62f4f0e32412026d1cdd60b4130f6e97848197ef0a80fe828b74407d9
|
|
BLAKE2b-256 checksum How to use checksums |
48b26f4bb63f9a89f7db1c8f2a14930504a0867969559e20236ca7ecc2a061d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2025.
Transparency logRelease files / vastcap-1.0.1-py3-none-any.whl
| Download URL | vastcap-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dba1a58fcf17eb313b1039dceae8460a95651125b041d99caf707ee405878798
|
|
BLAKE2b-256 checksum How to use checksums |
a51182234286597605fecfacac2bc7ea8bd8176596bc35bb9c37040fd8a39a77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 10, 2025.
Transparency log