Get Kasada headers with the API

By solvethree2 min read

Request a KasadaTask for the exact HTTPS URL on www.ticketmaster.com, then use the returned headers in your target request. Standalone Kasada currently supports that host.

On this page

Request the headers

Use Python 3.10+ or Node.js 22+ with the official SDK. Install the SDK from the official downloads.

Set SOLVETHREE_API_KEY to your workspace API key and SOLVETHREE_PROXY to your proxy URL. Run this on the server so the API key stays private. Change url to the intended HTTPS URL on the supported host.

Python · Kasada headers
import os
from uuid import uuid4
from solvethree import Solvethree

client = Solvethree(os.environ["SOLVETHREE_API_KEY"])
request = {
    'type': 'KasadaTask',
    'url': 'https://www.ticketmaster.com/',
    "proxy": os.environ["SOLVETHREE_PROXY"],
    "requestId": str(uuid4()),
}
result = client.solve(request, timeout=180)
headers = result["solution"]["headers"]
print("Ready task:", result["id"])

Both examples call solve, which creates one task and polls until it is ready or raises an error. The next section sends the returned headers to the target.

The task supplies type, url, a single proxy, and an optional requestId. Don't add custom browser identity fields: use the identity returned in the solution.

Send the returned headers to the target

Kasada result · illustrative headers
{
  "id": "example-kasada",
  "status": "ready",
  "solution": {
    "headers": {
      "x-kpsdk-ct": "EXAMPLE_HEADER_VALUE",
      "x-kpsdk-cd": "EXAMPLE_HEADER_VALUE"
    },
    "userAgent": "EXAMPLE_USER_AGENT",
    "secChUa": "EXAMPLE_CLIENT_HINTS"
  }
}

Copy the whole solution.headers object. Set User-Agent and sec-ch-ua from the result, and use the same proxy as the solve:

Python requests · send the returned Kasada headers
# Continue after the Kasada solve. Install requests separately: pip install requests.
import requests

solution = result["solution"]
headers = {name: value for name, value in solution["headers"].items()
           if name.lower() not in {"user-agent", "sec-ch-ua"}}
headers.update({"User-Agent": solution["userAgent"], "sec-ch-ua": solution["secChUa"]})
response = requests.get(
    request["url"], headers=headers,
    proxies={"http": request["proxy"], "https": request["proxy"]},
    timeout=30, allow_redirects=False,
)
print("Target HTTP status:", response.status_code)

These continuations require requests in Python or undici in Node.js. They send the exact URL from the task and replace conflicting browser headers. Keep any other application headers or session data your target requires.

If you use proxyCandidates, select the winning proxy with successful_proxy or successfulProxy before sending the target request. The single-proxy examples reuse request["proxy"] in Python or request.proxy in Node.js.

Check the target response after submission. For a 403, use the Ticketmaster troubleshooting guide to check which request is being rejected.

Waiting and errors

solve() handles polling for you. To receive the task ID immediately, use create_task or createTask with a zero wait, then retrieve that ID until it reaches ready or failed.

With the raw API, Kasada creation waits up to 75 seconds by default. Set your HTTP timeout above that wait, or use ?waitMs=0 and poll. See task polling and timeouts for the request sequence.

On a failed task, stop polling and inspect errorCode and error. Failed solves are refunded. If creation times out, keep the same requestId and inputs when recovering it; a new ID can create another billable solve.

Run your first task.

Start with $5 in workspace credit.

Create a workspace