Skip to main content

ParallaxAPIs SDK

Project description

🚀 Parallax SDK: Datadome & Perimeterx (Python)

Easily interact with Datadome and Perimeterx anti-bot solutions using a simple Python SDK. Fast integration, clear API! ✨


📦 Installation

pip

 pip install parallax-sdk-py

uv

 uv add parallax-sdk-py

🧑‍💻 Datadome Usage

⚡ SDK Initialization

from parallax_sdk_py.src.datadome import DatadomeSDK

# Basic initialization with API key and host
sdk = DatadomeSDK(host="dd.parallaxsystems.io", api_key="key")

🕵️‍♂️ Generate New User Agent

from parallax_sdk_py.src.datadome import DatadomeSDK
from parallax_sdk_py.src.tasks import TaskGenerateUserAgent

sdk = DatadomeSDK(host="dd.parallaxsystems.io", api_key="key")

user_agent = await sdk.generate_user_agent(TaskGenerateUserAgent(
    region="pl",
    site="vinted",
    pd="optional"
))

print(user_agent)
# Output:
# {
#     'UserAgent': 'Mozilla/5.0 ...',
#     'secHeader': '...',
#     'secFullVersionList': '...',
#     'secPlatform': '...',
#     'secArch': '...'
# }

🔍 Get Task Data

from parallax_sdk_py.src.datadome import DatadomeSDK

sdk = DatadomeSDK(host="dd.parallaxsystems.io", api_key="key")

challenge_url = "https://geo.captcha-delivery.com/captcha/?initialCid=initialCid&cid=cid&referer=referer&hash=hash&t=t&s=s&e=e"
cookie = "cookie"
task_data, product_type = await sdk.parse_challenge_url(challenge_url, cookie)

print(task_data, product_type)
# Output:
# GenerateDatadomeCookieData(
#     cid="cookie",
#     b="",
#     e="e",
#     s="s",
#     initialCid="initialCid"
# ), ProductType.Captcha

🍪 Generate Cookie

from parallax_sdk_py.src.datadome import DatadomeSDK
from parallax_sdk_py.src.tasks import TaskGenerateDatadomeCookie

sdk = DatadomeSDK(host="dd.parallaxsystems.io", api_key="key")

challenge_url = "https://geo.captcha-delivery.com/captcha/?initialCid=initialCid&cid=cid&referer=referer&hash=hash&t=t&s=s&e=e"
cookie = "cookie"
task_data, product_type = await sdk.parse_challenge_url(challenge_url, cookie)

cookie_response = await sdk.generate_cookie(TaskGenerateDatadomeCookie(
    site="vinted",
    region="pl",
    data=task_data,
    pd=product_type,
    proxy="http://user:pas@addr:port",
    proxyregion="eu"
))

print(cookie_response)
# Output:
# {
#     'cookie': 'datadome=cookie_value',
#     'userAgent': 'Mozilla/5.0 ...'
# }

🛡️ Perimeterx Usage

⚡ SDK Initialization

from parallax_sdk_py.src.px import PerimeterxSDK

# Basic initialization with API key and host
sdk = PerimeterxSDK(host="api.parallaxsystems.io", api_key="key")

🍪 Generate PX Cookie

from parallax_sdk_py.src.px import PerimeterxSDK
from parallax_sdk_py.src.tasks import TaskGeneratePXCookies, TaskGenerateHoldCaptcha

sdk = PerimeterxSDK(host="api.parallaxsystems.io", api_key="key")

result = await sdk.generate_cookies(TaskGeneratePXCookies(
    proxy="http://user:pas@addr:port",
    proxyregion="eu",
    region="com",
    site="stockx"
))

print(result)
# Output:
# {
#     'cookie': '_px3=d3sswjaltwxgAd...',
#     'vid': '514d7e11-6962-11f0-810f-88cc16043287',
#     'cts': '514d8e28-6962-11f0-810f-51b6xf2786b0',
#     'isFlagged': False,
#     'isMaybeFlagged': True,
#     'UserAgent': 'Mozilla/5.0 ...',
#     'data': '==WlrBti6vpO6rshP1CFtBsiocoO8...'
# }

hold_captcha_result = await sdk.generate_hold_captcha(TaskGenerateHoldCaptcha(
    proxy="http://user:pas@addr:port",
    proxyregion="eu",
    region="com",
    site="stockx",
    data=result['data'],
    POW_PRO=None
))

print(hold_captcha_result)
# Output:
# {
#     'cookie': '_px3=d3sswjaltwxgAd...',
#     'vid': '514d7e11-6962-11f0-810f-88cc16043287',
#     'cts': '514d8e28-6962-11f0-810f-51b6xf2786b0',
#     'isFlagged': False,
#     'isMaybeFlagged': True,
#     'UserAgent': 'Mozilla/5.0 ...',
#     'data': '==WlrBti6vpO6rshP1CFtBsiocoO8...',
#     'flaggedPOW': False
# }

📚 Documentation & Help


📝 License

MIT


Made with ❤️ by Parallax Systems

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

parallaxapis_sdk_py-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

parallaxapis_sdk_py-1.0.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for parallaxapis_sdk_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5d070915c7fd472e6643c5a0cf74147ccd90f1ac5cc0cd70cfe905fe1b19cacd
MD5 bc17127dca226b01656bfc464c3b5e91
BLAKE2b-256 58a1984c0508a202ba397c5173a9178ecd2f3b36a850085e66eb6cbe89cc28ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for parallaxapis_sdk_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d453c87aebbed44818da65d65e214e450a4c6ec8ae059287e6ec982fed1699b
MD5 a7eea23ac12d1ef9d68454aa828a8544
BLAKE2b-256 6b8c5ba612734707b94d0152ddaf2332a02434c96c2298ace2d65098a3363bf2

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