Skip to main content

TikTok Captcha Solver (ocacaptcha)

Automate TikTok captcha solving using Selenium, Playwright, Nodriver, or directly via HTTP API (without launching a browser).


🚀 Features

  • ⚡ Direct API Mode (oca_solve_captcha_api): Solve captchas fast using raw HTTP requests (requests) with zero browser overhead.
  • 🌐 Browser Integration (oca_solve_captcha): Built-in support for Selenium, Playwright, and Nodriver.
  • 🧩 Supported Captcha Types: tiktokWhirl, tiktokSlide, tiktok3D, tiktokIcon, and tiktokAllInOne.
  • 🔄 Automatic Retries: Built-in retry handling and parameter validation.

📦 Prerequisites & Installation

Choose the installation path depending on how you plan to use the library:

Option 1: Direct API Mode (Lightweight, No Browser)

pip install requests ocacaptcha

Option 2: Browser Automation Mode

  • For Selenium:
pip install selenium ocacaptcha

(Make sure to download ChromeDriver matching your Chrome version).

  • For Playwright:
pip install playwright ocacaptcha
playwright install
  • For Nodriver:
pip install nodriver ocacaptcha

💻 Usage Examples

1. Direct API Mode (Without Browser)

Use oca_solve_captcha_api when you don't need browser rendering:

from ocacaptcha import oca_solve_captcha_api

def main():
    user_api_key = "YOUR_API_KEY_HERE"
    action_type = "tiktokAllInOne"
    captcha_img_width = 348
    captcha_img_height = 217
    encrypt_data = "YOUR_ENCRYPTED_CAPTCHA_DATA"
    number_captcha_attempts = 10

    print("[*] Solving captcha via Direct API...")

    response = oca_solve_captcha_api(
        user_api_key=user_api_key,
        action_type=action_type,
        encrypt_data=encrypt_data,
        captcha_img_width=captcha_img_width,
        captcha_img_height=captcha_img_height,
        number_captcha_attempts=number_captcha_attempts
    )

    if response:
        print("[+] Success!")
        print(response)
    else:
        print("[!] Captcha solving failed.")

if __name__ == "__main__":
    main()

2. Browser Automation Mode (Selenium Example)

Use oca_solve_captcha when interacting with an open browser instance:

from selenium import webdriver
from ocacaptcha import oca_solve_captcha

driver = webdriver.Chrome()
driver.get("[https://www.tiktok.com/login](https://www.tiktok.com/login)")

result = oca_solve_captcha(
    driver=driver,
    user_api_key="YOUR_API_KEY_HERE",
    action_type="tiktokAllInOne",
    number_captcha_attempts=10,
    wait_captcha_seconds=5,
    solve_captcha_speed="fast"
)

👉 More examples can be found in this GitHub Gist.


🔑 Obtaining an OCA API Key

To get an API key, follow these steps in our Telegram Bot:

  1. Open the bot and send the /start command.
  2. Select your preferred language (English or Russian).
  3. Navigate to Another services / Другие услуги.
  4. Select Captcha / Капча to generate your API key.
  5. Copy your API key and make sure you have sufficient balance.

🛠 Dependencies

  • requests
  • selenium (optional)
  • playwright (optional)
  • nodriver (optional)

📬 Contact & Support

For questions, issues, or business inquiries:

Metadata

Release files for ocacaptcha 0.2.62

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocacaptcha 0.2.62
File Size Uploaded Provenance Actions
ocacaptcha-0.2.62.tar.gz 26.9 kB Without provenance Details for ocacaptcha-0.2.62.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ocacaptcha 0.2.62
File Interpreter ABI Platform Actions
ocacaptcha-0.2.62-py3-none-any.whl Python 3 none any Details for ocacaptcha-0.2.62-py3-none-any.whl

Total release size: 55.5 kB

Release files / ocacaptcha-0.2.62.tar.gz

Download URL ocacaptcha-0.2.62.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f9d67a9e4b5ffe97644b1e8615d2a9fbd305468ffbb452ca60391b88520bdd18
BLAKE2b-256 checksum
How to use checksums
d4e0087daeb1f844c5beef8ebb5dac8f4bab704fa0c1a99fe0de4079ed07833a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Release files / ocacaptcha-0.2.62-py3-none-any.whl

Download URL ocacaptcha-0.2.62-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72ab088e06f4fa442de3a2af8e9015f3b136e41437b25af20635721d8682f3ce
BLAKE2b-256 checksum
How to use checksums
8cb11d141799590fdc3a66bb483ca76d784a8e7f75794bf15e7f0f161e013fc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Security for ocacaptcha 0.2.62

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.62 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page