parallaxsdk

package module
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 10 Imported by: 0

README

Parallax Logo ParallaxAPIs SDK - GoLang Library for Bot Protection Bypass (Datadome & PerimeterX)

license MIT Go

Discord

Go SDK for bypassing DataDome and PerimeterX anti-bot protection.

📖 Overview

ParallaxAPIs provides a request-based solution for bypassing DataDome and PerimeterX antibot systems. Instead of relying on slow, resource-heavy browser automation, our API generates valid cookies and tokens in 200-400ms through direct HTTP requests.

What We Solve:

  • DataDome - Slider captchas, interstitial pages, cookie generation, tags payload
  • PerimeterX - Cookie generation (_px3), challenge solver, vid & cts tokens

Key Benefits:

  • Lightning Fast - 200-400ms response times vs 5-10+ seconds for browsers
  • 🔧 Simple Integration - Clean API with comprehensive documentation, no browser management required
  • 🚀 Highly Scalable - Handle thousands of concurrent requests with minimal resources
  • ⚙️ Flexible Configuration - Custom timeouts, HTTP clients, and proxy settings
  • 💰 Cost Effective - Lightweight infrastructure, minimal proxy usage
  • 🔄 Always Updated - We handle all reverse engineering and updates for you

🚀 Quick Start

Get started with ParallaxAPIs SDK's in under 5 minutes:

  1. Join our Discord - Connect with our community
  2. Get your free trial - Start testing immediately
  3. Install the SDK - Choose your preferred language
  4. Solve all antibots in seconds - Start bypassing DataDome, PerimeterX & more

📦 Installation

go get github.com/ParallaxAPIs/parallaxapis-sdk-go

Go Get Demo


🧑‍💻 Datadome Usage

⚡ SDK Initialization
import (
    "time"
    "github.com/ParallaxAPIs/parallaxapis-sdk-go"
)

// Basic initialization with API key
sdk := parallaxsdk.NewDatadomeSDK("Key", "")

// Custom host
sdk := parallaxsdk.NewDatadomeSDK("Key", "https://example.host.com")

// With custom timeout (default is 30 seconds)
sdk := parallaxsdk.NewDatadomeSDK("Key", "", parallaxsdk.WithCustomTimeout(60*time.Second))

// With HTTP proxy for client requests
sdk := parallaxsdk.NewDatadomeSDK("Key", "", parallaxsdk.WithClientProxy("http://user:pass@proxy.example.com:8080"))

// Multiple options combined
sdk := parallaxsdk.NewDatadomeSDK("Key", "https://example.host.com",
    parallaxsdk.WithCustomTimeout(45*time.Second),
    parallaxsdk.WithClientProxy("http://user:pass@proxy.example.com:8080"),
    parallaxsdk.WithInsecureSkipVerify(),
)

usage, err := sdk.CheckUsage("site")
if err != nil {
    fmt.Println("Error checking usage:", err)
    return
}
fmt.Println(usage)
🕵️‍♂️ Generate New User Agent
sdk := parallaxsdk.NewDatadomeSDK("Key", "")

userAgent, err := sdk.GenerateUserAgent(parallaxsdk.TaskGenUserAgent{
    Region: "com",
    Site: "site",
})
if err != nil {
    panic(err)
}

fmt.Println(userAgent)
🔍 Get Task Data
sdk := parallaxsdk.NewDatadomeSDK("Key", "")

challengeURL := "https://www.example.com/captcha/?initialCid=initialCid&cid=cid&referer=referer&hash=hash&t=t&s=1&e=e"
cookie := "cookie_value"

taskData, productType, err := parallaxsdk.ParseChallengeURL(challengeURL, cookie)
if err != nil {
    panic(err)
}

fmt.Println(taskData, productType)
📄 Parse Challenge HTML
htmlBody := "<html><script>dd={example:1}</script></html>"
prevCookie := "cookie_value"

taskData, productType, err := parallaxsdk.ParseChallengeHTML(htmlBody, prevCookie)
if err != nil {
    panic(err)
}

fmt.Println(taskData, productType)
sdk := parallaxsdk.NewDatadomeSDK("Key", "")

challengeURL := "https://www.example.com/captcha/?initialCid=initialCid&cid=cid&referer=referer&hash=hash&t=t&s=1&e=e"
cookie := "cookie_value"

taskData, productType, err := parallaxsdk.ParseChallengeURL(challengeURL, cookie)
if err != nil {
    panic(err)
}

cookieResp, err := sdk.GenerateDatadomeCookie(parallaxsdk.TaskDatadomeCookie{
    Site: "site",
    Region: "com",
    Data: *taskData,
    Pd: productType,
    Proxy: "http://user:pas@addr:port",
    Proxyregion: "eu",
})
if err != nil {
    panic(err)
}

fmt.Println(cookieResp)
sdk := parallaxsdk.NewDatadomeSDK("Key", "")

cookieResp, err := sdk.GenerateDatadomeTagsCookie(parallaxsdk.TaskDatadomeTagsCookie{
    Site: "site",
    Region: "com",
    Proxy: "http://user:pas@addr:port",
    Proxyregion: "eu",
    Cid: "cookie_value"
})
if err != nil {
    panic(err)
}

fmt.Println(cookieResp)
🔍 Detect and Parse Challenge
sdk := parallaxsdk.NewDatadomeSDK("Key", "")

responseBody := "<html>...</html>" // Response body from website
prevCookie := "cookie_value"

isBlocked, taskData, productType, err := parallaxsdk.DetectChallengeAndParse(responseBody, prevCookie)
if err != nil {
    panic(err)
}

if isBlocked {
    cookieResp, err := sdk.GenerateDatadomeCookie(parallaxsdk.TaskDatadomeCookie{
        Site: "site",
        Region: "com",
        Data: *taskData,
        Pd: productType,
        Proxy: "http://user:pas@addr:port",
        Proxyregion: "eu",
    })
    if err != nil {
        panic(err)
    }

    fmt.Println(cookieResp)
}

🛡️ Perimeterx Usage

⚡ SDK Initialization
import (
    "time"
    "github.com/ParallaxAPIs/parallaxapis-sdk-go"
)

// Basic initialization with API key
sdk := parallaxsdk.NewPerimeterxSDK("Key", "")

// Custom host
sdk := parallaxsdk.NewPerimeterxSDK("Key", "example.host.com")

// With custom timeout (default is 30 seconds)
sdk := parallaxsdk.NewPerimeterxSDK("Key", "", parallaxsdk.WithCustomTimeout(60*time.Second))

// With HTTP proxy for client requests
sdk := parallaxsdk.NewPerimeterxSDK("Key", "", parallaxsdk.WithClientProxy("http://user:pass@proxy.example.com:8080"))

// Multiple options combined
sdk := parallaxsdk.NewPerimeterxSDK("Key", "example.host.com",
    parallaxsdk.WithCustomTimeout(45*time.Second),
    parallaxsdk.WithClientProxy("http://user:pass@proxy.example.com:8080"),
    parallaxsdk.WithInsecureSkipVerify(),
)

usage, err := sdk.CheckUsage("site")
if err != nil {
    fmt.Println("Error checking usage:", err)
    return
}
fmt.Println(usage)
sdk := parallaxsdk.NewPerimeterxSDK("Key", "")

result, err := sdk.GenerateCookies(parallaxsdk.TaskGeneratePXCookies{
    Proxy: "http://user:pas@addr:port",
    Proxyregion: "eu",
    Region: "com",
    Site: "site",
})
if err != nil {
    panic(err)
}

fmt.Printf(result)


holdCaptchaResult, err := sdk.GenerateHoldCaptcha(parallaxsdk.TaskGenerateHoldCaptcha{
    Proxy: "http://user:pas@addr:port",
    Proxyregion: "eu",
    Region: "com",
    Site: "site",
    Data: result.Data,
    PowPro: "",
})
if err != nil {
    panic(err)
}

fmt.Printf(holdCaptchaResult)

📚 Documentation & Help

🌟 Contributing

Got feedback or found a bug? Feel free to open an issue or send us a pull request!

🏢 Enterprise

Unlock enterprise-grade performance with custom solutions, expanded limits, and expert support. Contact us to learn more.

📝 License

MIT


🔑 Keywords

DataDome bypassPerimeterX bypassAnti-bot bypassBot detection bypassCAPTCHA solverCookie generatorGo web scrapingGo bot automationGolang anti-botDataDome Go SDKPerimeterX Go SDKHeadless browser alternativeRequest-based bypassGo automationWeb scraping GoBot mitigation bypassSensor data generationChallenge solver

Documentation

Index

Constants

View Source
const (
	PD_Captcha      = "captcha"
	PD_Interstitial = "interstitial"
	PD_Init         = "init"
)

TODO add separate type for ProductTypes

View Source
const (
	// Perma block
	T_BV = "bv"
	// Captcha
	T_FE = "fe"
	// Intersitial
	T_IT = "it"
)
View Source
const DefaultDDHost = "https://dd.parallaxsystems.io"
View Source
const DefaultPXHost = "https://api.parallaxsystems.io"

Variables

View Source
var ErrInvalidChallengeURL = fmt.Errorf("invalid challenge URL")

ErrInvalidChallengeURL means the URL failed to parse.

View Source
var ErrNoDatadomeValuesInHtml = fmt.Errorf("no DataDome values in HTML body")

ErrNoDatadomeValuesInHtml means no Datadome values were found in the HTML body

View Source
var ErrPermanentlyBlocked = fmt.Errorf("permanently blocked by DataDome (t=bv)")

ErrPermanentlyBlocked means the challenge indicates a permanent block (t=bv)

View Source
var ErrUnknownChallengeType = fmt.Errorf("unknown challenge type in URL")

ErrUnknownChallengeType means we couldn’t identify captcha/interstitial/init.

View Source
var ErrUnparsableDatadomeJSONBody = fmt.Errorf("unparsable DataDome JSON body")

ErrUnparsableDatadomeBody means the JSON body could not be parsed or did not contain a URL

Functions

This section is empty.

Types

type APIError

type APIError struct{ Message string }

func (*APIError) Error

func (e *APIError) Error() string

type ClientProxyOption

type ClientProxyOption string

func WithClientProxy

func WithClientProxy(proxy string) ClientProxyOption

type CustomTimeoutOption

type CustomTimeoutOption time.Duration

func WithCustomTimeout

func WithCustomTimeout(d time.Duration) CustomTimeoutOption

type DatadomeCookieResponse

type DatadomeCookieResponse struct {
	Message   string `json:"message"`
	UserAgent string `json:"UserAgent"`
}

DatadomeCookieResponse is the response type for DataDome cookie generation.

type DatadomeSDK

type DatadomeSDK struct {
	*SDK
}

func NewDatadomeSDK

func NewDatadomeSDK(key, host string, options ...Option) *DatadomeSDK

type ErrorEnv

type ErrorEnv struct {
	Error   bool   `json:"error"`
	Message string `json:"message"`
}

type GenHoldCaptchaResponse

type GenHoldCaptchaResponse struct {
	PxCookieResponse
	FlaggedPow bool `json:"flaggedPOW"` // Indicates if pow is flagged.
}

GenHoldCaptchaResponse is the response type for holdingcaptcha challenge.

type HtmlScriptObject

type HtmlScriptObject struct {
	B      int    `json:"b"`
	Rt     string `json:"rt"`
	Cid    string `json:"cid"`
	Hsh    string `json:"hsh"`
	T      string `json:"t"`
	Qp     string `json:"qp"`
	S      int    `json:"s"`
	E      string `json:"e"`
	Host   string `json:"host"`
	Cookie string `json:"cookie"`
}

type InsecureSkipVerifyOption

type InsecureSkipVerifyOption bool

func WithInsecureSkipVerify

func WithInsecureSkipVerify() InsecureSkipVerifyOption

type JsonDatadomeBlockBody

type JsonDatadomeBlockBody struct {
	URL string `json:"url"`
}

type Option

type Option any

type PXErrorDetails added in v1.1.2

type PXErrorDetails struct {
	Cookie         string `json:"cookie"`
	IsFlagged      bool   `json:"isFlagged"`
	IsMaybeFlagged bool   `json:"isMaybeFlagged"`
	FlaggedPow     bool   `json:"flaggedPOW"`
}

type PayloadGenDatadomeCookie

type PayloadGenDatadomeCookie struct {
	Auth        string                 `json:"auth"`        // The API key used for authenticating SDK requests.
	Site        string                 `json:"site"`        // Site for which to generate the cookie.
	Region      string                 `json:"region"`      // Site region.
	Proxyregion string                 `json:"proxyregion"` // The region of your proxy (either "eu" or "us").
	Proxy       string                 `json:"proxy"`       // Proxy address.
	Pd          string                 `json:"pd"`          // Product type.
	Data        TaskDatadomeCookieData `json:"data"`        // Data required for cookie generation.
}

PayloadGenDatadomeCookie is the payload for generating a DataDome cookie.

type PayloadGenHoldCaptcha

type PayloadGenHoldCaptcha struct {
	Auth string `json:"auth"` // The API key used for authenticating SDK requests.
	TaskGenerateHoldCaptcha
}

PayloadGenHoldCaptcha is the payload for the holdcaptcha challenge.

type PayloadGenPXCookie

type PayloadGenPXCookie struct {
	Auth string `json:"auth"` // The API key used for authenticating SDK requests.
	TaskGeneratePXCookies
}

PayloadGenPXCookie is the payload for generating PX cookies.

type PayloadGenUserAgent

type PayloadGenUserAgent struct {
	Auth   string `json:"auth"` // The API key used for authenticating SDK requests.
	Site   string `json:"site"`
	Region string `json:"region"`
	Pd     string `json:"pd"`
}

PayloadGenUserAgent is the payload for generating a user agent.

type PerimeterxSDK

type PerimeterxSDK struct {
	*SDK
}

func NewPerimeterxSDK

func NewPerimeterxSDK(key, host string, options ...Option) *PerimeterxSDK

func (*PerimeterxSDK) GenerateCookies

func (sdk *PerimeterxSDK) GenerateCookies(task TaskGeneratePXCookies) (*PxCookieResponse, error)

func (*PerimeterxSDK) GenerateHoldCaptcha

func (sdk *PerimeterxSDK) GenerateHoldCaptcha(task TaskGenerateHoldCaptcha) (*GenHoldCaptchaResponse, error)

type PxCookieResponse

type PxCookieResponse struct {
	Cookie         string `json:"cookie"`
	Vid            string `json:"vid"` // Used to set the _pxvid cookie.
	Cts            string `json:"cts"` // Used to set the pxcts cookie.
	Uuid           string `json:"uuid"`
	Model          string `json:"model"`          // The device model used for generation.
	DeviceFp       string `json:"device_fp"`      // The device fingerprint used for generation.
	IsFlagged      bool   `json:"isFlagged"`      // Indicate if the generation might have been flagged during generation.
	IsMaybeFlagged bool   `json:"isMaybeFlagged"` // Indicate if the generation might have been flagged during generation.
	UserAgent      string `json:"UserAgent"`      // The device used for generation.
	Data           string `json:"data"`           // A string used to generate the next step.
}

PxCookieResponse is the response type for PX cookies generation.

type SDK

type SDK struct {
	AuthKey string
	APIHost string
	// contains filtered or unexported fields
}

func CreateClient

func CreateClient(authKey, apiHost string, options ...Option) *SDK

func (*SDK) CheckUsage

func (s *SDK) CheckUsage(site string) (UsageResponse, error)

checkUsage EP

func (*SDK) GenerateDatadomeCookie

func (s *SDK) GenerateDatadomeCookie(task TaskDatadomeCookie) (*DatadomeCookieResponse, error)

GenerateDatadomeCookie generates a DataDome cookie using the provided task parameters.

func (*SDK) GenerateDatadomeTagsCookie

func (s *SDK) GenerateDatadomeTagsCookie(task TaskDatadomeTagsCookie) (*DatadomeCookieResponse, error)

GenerateDatadomeTagsCookie generates a DataDome tags cookie using the provided task parameters.

func (*SDK) GenerateUserAgent

func (s *SDK) GenerateUserAgent(task TaskGenUserAgent) (*UserAgentResponse, error)

GenerateUserAgent generates a user agent data.

type TaskDatadomeCookie

type TaskDatadomeCookie struct {
	Site        string                 `json:"site"`        // Site for which to generate the cookie.
	Region      string                 `json:"region"`      // Site region.
	Proxyregion string                 `json:"proxyregion"` // The region of your proxy (either "eu" or "us").
	Proxy       string                 `json:"proxy"`       // Proxy address.
	Pd          string                 `json:"pd"`          // Product type.
	Data        TaskDatadomeCookieData `json:"data"`        // Data required for cookie generation.
}

TaskDatadomeCookie represents a task for generating a DataDome cookie.

type TaskDatadomeCookieData

type TaskDatadomeCookieData struct {
	Cid        string `json:"cid"`
	E          string `json:"e"`
	S          string `json:"s"`
	B          string `json:"b"`
	InitialCid string `json:"initialCid"`
}

TaskDatadomeCookieData contains data required for generating a Datadome cookie.

func DetectChallengeAndParse

func DetectChallengeAndParse(body, prevCookie string) (bool, *TaskDatadomeCookieData, string, error)

DetectChallengeAndParse detects the challenge type and parses accordingly.

func ParseChallengeHTML

func ParseChallengeHTML(htmlBody, prevCookie string) (*TaskDatadomeCookieData, string, error)

ParseChallengeHTML parses HTML and extracts DataDome challenge data from a JS object.

func ParseChallengeJSON

func ParseChallengeJSON(jsonBody, prevCookie string) (*TaskDatadomeCookieData, string, error)

ParseChallengeJSON parses a JSON body containing a DataDome challenge URL.

func ParseChallengeURL

func ParseChallengeURL(challengeURL, prevCookie string) (*TaskDatadomeCookieData, string, error)

ParseChallengeURL parses a DataDome challenge URL and extracts the challenge data and product type.

type TaskDatadomeTagsCookie

type TaskDatadomeTagsCookie struct {
	Site        string `json:"site"`        // Site for which to generate the cookie.
	Region      string `json:"region"`      // Site region.
	Proxyregion string `json:"proxyregion"` // The region of your proxy (either "eu" or "us").
	Proxy       string `json:"proxy"`       // Proxy address.
	Cid         string `json:"cid"`         // Data required for cookie generation.
}

TaskDatadomeTagsCookie represents a task for generating a DataDome tags cookie.

type TaskGenUserAgent

type TaskGenUserAgent struct {
	Site   string `json:"site"`
	Region string `json:"region"`
}

TaskGenUserAgent represents a task for generating useragent data.

type TaskGenerateHoldCaptcha

type TaskGenerateHoldCaptcha struct {
	Site        string `json:"site"`
	Region      string `json:"region"`
	Proxyregion string `json:"proxyregion"` // The region of your proxy (either "eu" or "us").
	Proxy       string `json:"proxy"`
	Data        string `json:"data"`    // Data required for cookie generation.
	PowPro      string `json:"POW_PRO"` // (Optional) Insert your Cuda POW solver key here.
}

TaskGenerateHoldCaptcha represents a task for hold captcha challenge.

type TaskGeneratePXCookies

type TaskGeneratePXCookies struct {
	Site        string `json:"site"`        // Site for which to generate cookies.
	Region      string `json:"region"`      // Site region.
	Proxyregion string `json:"proxyregion"` // Proxy region.
	Proxy       string `json:"proxy"`       // Proxy address.
}

TaskGeneratePXCookies represents a task for generating PX cookies.

type UsageResponse

type UsageResponse struct {
	UsedRequests string `json:"usedRequests"`
	RequestsLeft int64  `json:"requestsLeft"`
}

type UserAgentResponse

type UserAgentResponse struct {
	Message            string `json:"message"`
	UserAgent          string `json:"UserAgent"`
	SecHeader          string `json:"secHeader"`
	SecFullVersionList string `json:"secFullVersionList"`
	SecPlatform        string `json:"secPlatform"`
	SecArch            string `json:"secArch"`
}

UserAgentResponse is the response type for user agent generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL