Skip to main content

Solve Cloudflare challenges: get a cf_clearance cookie, matching User-Agent, and proxy for your own client. Official Python client for the RaptorWayz API.

Project description

raptorwayz (Python)

Solve Cloudflare challenges from Python. Get a valid cf_clearance cookie, the matching User-Agent, and a proxy on the same exit IP, then make your own request with requests, httpx, or anything else.

Official Python client for RaptorWayz. Get an API key (5 free solves) there.

pip install raptorwayz

Usage

import requests
from raptorwayz import RaptorWayz

rw = RaptorWayz("bk_your_api_key")
c = rw.solve("example.com")

resp = requests.get(
    "https://example.com/",
    headers=c.headers,     # {"User-Agent": "..."}
    cookies=c.cookies,     # {"cf_clearance": "..."}
    proxies=c.proxies,     # {"http": "...", "https": "..."}
)
print(resp.status_code)    # 200

All three (cookie, User-Agent, and proxy) must be used together, or Cloudflare re-challenges.

With httpx

import httpx
from raptorwayz import RaptorWayz

c = RaptorWayz("bk_your_api_key").solve("example.com")
with httpx.Client(proxy=c.proxy, headers=c.headers, cookies=c.cookies) as client:
    print(client.get("https://example.com/").status_code)

Errors

from raptorwayz import RaptorWayz, RaptorWayzError, NoChallenge

try:
    c = RaptorWayz("bk_...").solve("example.com")
except NoChallenge as nc:
    ...  # domain has no challenge, just use nc.proxy with a normal UA
except RaptorWayzError as e:
    print(e.code, e.status, e.seconds_until_next)  # e.g. "window_active", 429, 900

MIT licensed. The client is open source; the hosted solving service is proprietary.

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

raptorwayz-1.0.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

raptorwayz-1.0.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file raptorwayz-1.0.0.tar.gz.

File metadata

  • Download URL: raptorwayz-1.0.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for raptorwayz-1.0.0.tar.gz
Algorithm Hash digest
SHA256 84569d18019b4c42ddcad735f466a8d83e9183e89992f523eb7a26a9c666e89c
MD5 642b9f3c6c55441419733549c1cf22bb
BLAKE2b-256 51df43681c38f7a603c9c64974a678a4316f9d5b6dca9b8f6f21a9a59a811834

See more details on using hashes here.

File details

Details for the file raptorwayz-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: raptorwayz-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for raptorwayz-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cefbbb2eeec00e81aacff942054f275992b55e023458b310ac7f315497038969
MD5 0cc6a2407e11cb0d55f78f4ed36a4856
BLAKE2b-256 f0f5b9ec101661c5247e5722531ed790dc4c54652f85d94c59112c6b09cf8adb

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