### Query documentation via HTTP GET Source: https://docs.takionapi.tech/llms.txt Perform a GET request to the documentation index with 'ask' and 'goal' parameters to receive a direct answer. ```http GET https://docs.takionapi.tech/start.md?ask=&goal= ``` -------------------------------- ### GET /plan Source: https://docs.takionapi.tech/start Retrieves the current plan details and status associated with the provided API key. ```APIDOC ## GET /plan ### Description Retrieves the status and plan details for the API key used in the request. This endpoint is available on any antibot subdomain. ### Method GET ### Endpoint /plan ### Parameters #### Header Parameters - **x-api-key** (string) - Required - Your API key for authentication. #### Query Parameters - **api_key** (string) - Required (if not in header) - Your API key for authentication. ### Response #### Success Response (200) - **plan_details** (object) - JSON object containing plan information. #### Error Responses - **400** - Invalid Input Parameters - **401** - Invalid API Key - **500** - Internal Server Error ``` -------------------------------- ### Example API Response Source: https://docs.takionapi.tech/cognito/api The response contains the token required for subsequent authentication requests. ```json { "response": "...", // Use this token for your next request } ``` -------------------------------- ### My B&B Integration Example Source: https://docs.takionapi.tech/px-mobile/examples Demonstrates sending requests to the My B&B API with and without PX-Mobile generated headers. ```python import requests API_KEY = "TAKION_API_XXXX" url = "https://api.bbw.com/payments/v2/giftcard" payload = { "lbCustomerID": "abyQtuW2FurvCkyKA3h2cLxUMh", "email": "xxx@gmail.com", "brand": "BBW", } def send_request_without_headers(): headers = { "accept-language": "it-IT,it;q=0.9", "accept-charset": "UTF-8", "accept": "*/*", "content-type": "application/json", } response = requests.post( url, json=payload, headers=headers ) print( f"Response without headers: {response.status_code} / {response.text}") def send_request_with_headers(): px_headers = requests.post( "https://px-mobile.takionapi.tech/generate", json={"package_name": "com.bathandbody.bbw", "manufacturer": "samsung"}, params={"api_key": API_KEY} ).json() headers = { "accept-language": "it-IT,it;q=0.9", "accept-charset": "UTF-8", "accept": "*/*", "content-type": "application/json", } | px_headers print(px_headers) exit(0) response = requests.post( url, json=payload, headers=headers ) print(f"Response with headers: {response.status_code} / {response.text}") if __name__ == "__main__": send_request_without_headers() print(" -------------------- ") send_request_with_headers() ``` -------------------------------- ### GET https://docs.takionapi.tech/start.md Source: https://docs.takionapi.tech/llms.txt Queries the documentation index with a specific question and an optional end goal to receive a tailored response. ```APIDOC ## GET https://docs.takionapi.tech/start.md ### Description Perform an HTTP GET request on the documentation index to ask a specific question and optionally provide a broader end goal for context. ### Method GET ### Endpoint https://docs.takionapi.tech/start.md ### Parameters #### Query Parameters - **ask** (string) - Required - The immediate question to ask, written in natural language. - **goal** (string) - Optional - Describes the broader end goal to help tailor the response. ``` -------------------------------- ### GET /generate Source: https://docs.takionapi.tech/castle/api Generates a Castle bypass token required for subsequent requests. ```APIDOC ## GET /generate ### Description Generates a `x-castle-request-token` by providing the site key and script ID. It is recommended to include browser headers like User-Agent and Accept-Language for better accuracy. ### Method GET ### Endpoint /generate ### Parameters #### Query Parameters - **scriptID** (number) - Required - A numeric scriptID parsed from the page's HTML. - **__cuid** (string) - Optional - The session's __cuid cookie. ### Response #### Success Response (200) - **__cuid** (string) - The session identifier to be set on your session. - **castle** (string) - The token to be used for your next request. #### Response Example { "__cuid": "...", "castle": "..." } ``` -------------------------------- ### GeeTest v3 API Response Example Source: https://docs.takionapi.tech/geetest/v3 The expected JSON response structure containing the challenge, validate, and seccode tokens required for verification. ```json { "response": { "geetest_challenge": "567fc6015320e44041dad5e517c73499", "geetest_validate": "ee08eee1cd458f705174a7638b74845b", "geetest_seccode": "ee08eee1cd458f705174a7638b74845b|jordan" } } ``` -------------------------------- ### GET /generate Source: https://docs.takionapi.tech/cognito/api Generates a cognitoAsfData token required for authentication by providing the website domain and user credentials. ```APIDOC ## GET /generate ### Description Generates a cognitoAsfData token to bypass Castle security. It is recommended to include User-Agent, Sec-Ch-Ua, and Accept-Language headers for accuracy. ### Method GET ### Endpoint /generate ### Parameters #### Query Parameters - **website** (string) - Required - The website domain - **username** (string) - Required - The username or mail used for authentication ### Response #### Success Response (200) - **response** (string) - The generated token to be used for subsequent requests #### Response Example { "response": "..." } ``` -------------------------------- ### GET /v3 Source: https://docs.takionapi.tech/geetest/v3 Submit GeeTest v3 captcha parameters to receive the validation response required to bypass the challenge. ```APIDOC ## GET /v3 ### Description Submit the captcha parameters to the API to retrieve the necessary validation tokens for bypassing the GeeTest v3 challenge. ### Method GET ### Endpoint /v3 ### Parameters #### Query Parameters - **gt** (string) - Required - The captcha's gt parameter. - **challenge** (string) - Required - The captcha's challenge parameter. - **proxy** (string) - Optional - Proxy for solving (format: ip:port or ip:port:mail:password). ### Response #### Success Response (200) - **response** (object) - The object containing the validation tokens. #### Response Example { "response": { "geetest_challenge": "567fc6015320e44041dad5e517c73499", "geetest_validate": "ee08eee1cd458f705174a7638b74845b", "geetest_seccode": "ee08eee1cd458f705174a7638b74845b|jordan" } } ``` -------------------------------- ### GET /generate Source: https://docs.takionapi.tech/nudata/api Retrieves the payload and input name for a given NuData script URL. ```APIDOC ## GET /generate ### Description This endpoint processes a NuData script URL to extract the required payload and input name parameters for the website configuration. ### Method GET ### Endpoint /generate ### Parameters #### Query Parameters - **url** (string) - Required - The NuData script URL. - **form_name** (string) - Optional - The form name being submitted. ### Response #### Success Response (200) - **payload** (string) - The value of the parameter to pass. - **input_name** (string) - The name of the parameter to pass. #### Response Example { "payload": "...", "input_name": "..." } ``` -------------------------------- ### Example Castle API Response Source: https://docs.takionapi.tech/castle/api The expected JSON structure returned by the API, containing the session identifier and the request token. ```json { "__cuid": "...", // Set this on your session if not provided "castle": "..." // Use this token for your next request } ``` -------------------------------- ### Ticketmaster SG Captcha Integration Note Source: https://docs.takionapi.tech/ocr/examples Placeholder example for Ticketmaster SG, noting that captchas are session-specific and require base64 conversion. ```python from requests import post from base64 import b64decode if __name__ == "__main__": API_KEY = "TAKION_API_XXX" # Fill it with your api key # Since on ticketmaster sg a captcha is assigned to your # session only after some actions are taken (like adding to cart) # we are going to set the value as fixed, in a real case scenario # you wanna convert the image to base64 and then send to the API ``` -------------------------------- ### GET /v4 Source: https://docs.takionapi.tech/geetest/v4 Submit a GeeTest v4 captcha ID to receive the necessary validation tokens and output for bypassing the captcha. ```APIDOC ## GET /v4 ### Description Submit a GeeTest v4 captcha ID to receive the necessary validation tokens and output for bypassing the captcha. ### Method GET ### Endpoint /v4 ### Parameters #### Query Parameters - **captcha_id** (string) - Required - The captcha's unique identifier. - **kind** (string) - Optional - The type of captcha to solve (defaults to "slide"). - **proxy** (string) - Optional - Proxy for solving (format: ip:port or ip:Port:mail:password). ### Response #### Success Response (200) - **response** (object) - The object containing the bypass result. - **captcha_id** (string) - The original captcha ID. - **lot_number** (string) - The lot number generated for the session. - **pass_token** (string) - The token used to pass the captcha. - **gen_time** (string) - The generation timestamp. - **captcha_output** (string) - The captcha output string. ### Response Example { "response": { "captcha_id": "fcd636b4514bf7ac4143922550b3008b", "lot_number": "e4c0b946b91c4aeabbc343b9a0f048ca", "pass_token": "4856da4c49ca...3edea00d688e", "gen_time": "1725490466", "captcha_output": "Vt45iXQep...==" } } ``` -------------------------------- ### Datadome Challenge HTML Structure Source: https://docs.takionapi.tech/datadome Example of the HTML response returned by a Datadome-protected site, featuring the 'dd' configuration object and required scripts. ```html footlocker.com

Please enable JS and disable any ad blocker

``` -------------------------------- ### Handle DataDome Challenge Response Source: https://docs.takionapi.tech/datadome/examples Processes a solved challenge response by performing a POST or GET request and updating the session with the resulting DataDome cookie. ```python print("(4) Posting challenge...") if solved_response["method"] == "POST": # Interstitial response = session.post( solved_response["url"], headers={ 'Host': 'geo.captcha-delivery.com', 'sec-ch-ua-platform': '"macOS"', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'sec-ch-ua': '"Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'sec-ch-ua-mobile': '?0', 'Accept': '*/*', 'Origin': 'https://geo.captcha-delivery.com', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Storage-Access': 'active', 'Referer': 'https://geo.captcha-delivery.com/interstitial/', 'Accept-Language': 'en-GB,en;q=0.9', }, data=solved_response["payload"] ) else: response = session.get( solved_response["url"], headers={ 'Host': 'geo.captcha-delivery.com', 'sec-ch-ua-platform': '"macOS"', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'sec-ch-ua': '"Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'sec-ch-ua-mobile': '?0', 'Accept': '*/*', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Storage-Access': 'active', 'Referer': 'https://geo.captcha-delivery.com/captcha/', 'Accept-Language': 'en-GB,en;q=0.9', }, params=solved_response["payload"] ) cookie = response.json()["cookie"].split("datadome=")[1].split(";")[0] print(f"\033[1;34m(5)Generated cookie: {cookie[:17]}...{cookie[-17:]}\033[0m") session.cookies.set("datadome", cookie) continue ``` -------------------------------- ### Simple PX-Mobile API Generation Source: https://docs.takionapi.tech/px-mobile/examples Basic implementation for generating headers using the PX-Mobile API endpoint. ```python import requests API_KEY = "TAKION_API_XXXX" # YOUR API KEY url = "https://px-mobile.takionapi.tech/generate" querystring = {"api_key": API_KEY} payload = { "package_name": "com.enflick.android.TextNow", "manufacturer": "samsung", "continent": "america" } headers = { "Content-Type": "application/json" } response = requests.request( "POST", url, json=payload, headers=headers, params=querystring) print(response.text) ``` -------------------------------- ### Cognito Authentication and Login Flow Source: https://docs.takionapi.tech/cognito/examples Configures request headers, generates Cognito data via the Takion API, and performs a session-based login. Requires valid API_KEY, MAIL, and PASSWORD variables. ```python headers = { 'Host': 'main.login.ticketmaster.sg', 'cache-control': 'max-age=0', 'sec-ch-ua': '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'upgrade-insecure-requests': '1', 'origin': 'https://main.login.ticketmaster.sg', 'content-type': 'application/x-www-form-urlencoded', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'sec-fetch-site': 'same-origin', 'sec-fetch-mode': 'navigate', 'sec-fetch-user': '?1', 'sec-fetch-dest': 'document', 'referer': 'https://main.login.ticketmaster.sg/login?client_id=6vdm5j83n4tc6i0ul4nm9ms6dm&redirect_uri=https%3A%2F%2Fticketmaster.sg%2Flogin&response_type=code&scope=phone+email+openid+aws.cognito.signin.user.admin', 'accept-language': 'en-GB,en;q=0.9', } # ------------------------- Generate cognito ------------------------- # response = get( "https://cognito.takionapi.tech/generate", params={ "api_key": API_KEY, "website": "www.ticketmaster.sg", "username": MAIL }, headers={ "User-Agent": headers["user-agent"], "sec-ch-ua": headers["sec-ch-ua"] } ).json()["result"] # ------------------------- Login into acc. ------------------------- # response = session.post( 'https://main.login.ticketmaster.sg/login', params={ 'client_id': '6vdm5j83n4tc6i0ul4nm9ms6dm', 'redirect_uri': 'https://ticketmaster.sg/login', 'response_type': 'code', 'scope': 'phone email openid aws.cognito.signin.user.admin', }, headers=headers, data={ '_csrf': session.cookies.get_dict()["XSRF-TOKEN"], 'username': MAIL, 'password': PASSWORD, 'cognitoAsfData': response, 'signInSubmitButton': 'Sign in', } ) if (redirect := response.headers.get("Location")): response = session.get(redirect, headers=headers) if (redirect := response.headers.get("Location")): response = session.get(redirect, headers=headers) soup = BeautifulSoup(response.text, "html.parser") if not (account_data := soup.find("div", {"id": "accountFunc"})): print(soup.find("p", {"id": "loginErrorMessage"}).text) exit(0) print("Logged in as " + account_data.find("div").text) ``` -------------------------------- ### Solve reese84 challenge with Python Source: https://docs.takionapi.tech/incapsula/examples Uses the tls_client library to fetch the challenge script, solve it via the Takion API, and set the resulting token in the session cookies. ```python from requests import post from tls_client import Session API_KEY = "TAKION_API_XXX" # Fill it with your api key if __name__ == "__main__": session = Session(client_identifier="chrome_111") response = session.get("https://www.ticketmaster.es/epsf/eps-d", headers={ "accept": "application/json; charset=utf-8", "accept-language": "en-GB,en;q=0.9", "content-type": "text/plain; charset=utf-8", "origin": "null", "priority": "u=1, i", "sec-ch-ua": '"Chromium";v="125", "Google Chrome";v="125", "Not-A.Brand";v="99"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"macOS\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" }) challenge_payload = post( "https://incapsula.takionapi.tech/reese84", json={ "script": response.text }, headers={ "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36", "x-api-key": API_KEY } ).json()['payload'] response = session.post( "https://epsf.ticketmaster.es/eps-d", headers={ "accept": "application/json; charset=utf-8", "accept-language": "en-GB,en;q=0.9", "content-type": "text/plain; charset=utf-8", "origin": "null", "priority": "u=1, i", "sec-ch-ua": '"Chromium";v="125", "Google Chrome";v="125", "Not-A.Brand";v="99"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"macOS\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" }, data=challenge_payload, params={"d":"www.ticketmaster.es"} ) response = response.json() # Set cookie session.cookies.set("reese84", response['token']) headers = { 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'accept-language': 'en-GB,en;q=0.9', 'cache-control': 'max-age=0', 'priority': 'u=0, i', 'referer': 'https://availability.ticketmaster.es/api/v2/TM_NL/availability/299807?subChannelId=1', 'sec-ch-ua': '"Chromium";v="125", "Google Chrome";v="125", "Not-A.Brand";v="99"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'sec-fetch-dest': 'document', 'sec-fetch-mode': 'navigate', 'sec-fetch-site': 'same-origin', 'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', } params = ( ('subChannelId', '1'), ) response = session.get('https://availability.ticketmaster.es/api/v2/TM_ES/availability/39185', headers=headers, params=params) print(response.text) ``` -------------------------------- ### Bypass Datadome Homepage Protection in Python Source: https://docs.takionapi.tech/datadome/examples Demonstrates a loop to load a protected page, detect Datadome challenges, and use the Takion API to solve them. Requires a valid TLS client session and an API key. ```python from tls_client import Session from requests import post from time import sleep API_KEY = "TAKION_API_XXX" if __name__ == "__main__": session = Session( client_identifier="chrome_136", random_tls_extension_order=True ) while 1: print("(1) Loading page...") response = session.get( 'https://datadome.co/', headers={ 'Host': 'datadome.co', 'sec-ch-ua': '"Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'sec-purpose': 'prefetch;prerender', 'purpose': 'prefetch', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'sec-fetch-site': 'none', 'sec-fetch-mode': 'navigate', 'sec-fetch-user': '?1', 'sec-fetch-dest': 'document', 'accept-language': 'en-GB,en;q=0.9', 'priority': 'u=0, i', } ) print(response.text[:200]) if response.status_code == 200: print("\033[1;32m" + f"Page loaded successfully: {response.status_code=}" + "\033[0m") break print("\033[1;33m" + f"Datadome detected! {response.status_code=}" + "\033[0m") build_response = post( "https://datadome.takionapi.tech/build", json={ "html": response.text, "referer": "https://datadome.co/", "datadome": session.cookies.get("datadome") }, headers={ "x-api-key": API_KEY } ).json() if (error := build_response.get("error")): print(error) sleep(3) continue challenge_url, ctype = build_response["url"], build_response["challenge_type"] print(f"(2) Detected \033[1;35m{ctype}\033[0m challenge, loading...") challenge_page = session.get( challenge_url, headers={ 'Host': 'geo.captcha-delivery.com', 'sec-ch-ua': '"Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'Sec-Fetch-Site': 'cross-site', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-Dest': 'iframe', 'Sec-Fetch-Storage-Access': 'active', 'Referer': 'https://datadome.co/', 'Accept-Language': 'en-GB,en;q=0.9', }) print("(3) Solving challenge...") solved_response = post( "https://datadome.takionapi.tech/solve", json={ "html": challenge_page.text, }, headers={ 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', "accept-language": "en-GB,en;q=0.9", "x-api-key": API_KEY } ).json() if (error := solved_response.get("error")): print(error) sleep(3) continue ``` -------------------------------- ### POST /build Source: https://docs.takionapi.tech/datadome/apis Generates the challenge payload required for the Datadome bypass process. ```APIDOC ## POST /build ### Description Generates a challenge payload to be used in the Datadome bypass process. ### Method POST ### Endpoint /build ``` -------------------------------- ### Example GeeTest v4 API Response Source: https://docs.takionapi.tech/geetest/v4 The JSON structure returned by the API upon successfully solving a GeeTest v4 captcha. ```json { "response": { "captcha_id": "fcd636b4514bf7ac4143922550b3008b", "lot_number": "e4c0b946b91c4aeabbc343b9a0f048ca", "pass_token": "4856da4c49ca...3edea00d688e", "gen_time": "1725490466", "captcha_output": "Vt45iXQep...==" } } ``` -------------------------------- ### POST /solve Source: https://docs.takionapi.tech/datadome/apis Submits the challenge payload to retrieve the Datadome cookie. ```APIDOC ## POST /solve ### Description Submits the generated challenge payload to retrieve a valid Datadome cookie. ### Method POST ### Endpoint /solve ``` -------------------------------- ### POST /generate Source: https://docs.takionapi.tech/px-mobile/api Generates the required headers to bypass PerimeterX protection for a specific Android application. ```APIDOC ## POST /generate ### Description Generates the necessary headers for bypassing PerimeterX protection by providing the Android application's package name and optional device information. ### Method POST ### Endpoint /generate ### Request Body - **package_name** (string) - Required - The package name of the Android app (e.g., com.enflick.android.TextNow). ``` -------------------------------- ### API Key Format Source: https://docs.takionapi.tech/start The standard format for a TakionAPI key used for authentication. ```text TAKION_API_XXXXXXXX ``` -------------------------------- ### Generate DailyPay Token via Castle API Source: https://docs.takionapi.tech/castle/examples Uses requests and regex to extract a script ID from the DailyPay login page, then sends it to the Takion API for processing. ```python from requests import get import requests import re headers = { 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8', 'cache-control': 'no-cache', 'pragma': 'no-cache', 'priority': 'u=0, i', 'sec-ch-ua': '"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'sec-fetch-dest': 'document', 'sec-fetch-mode': 'navigate', 'sec-fetch-site': 'none', 'sec-fetch-user': '?1', 'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36', } params = { 'utm_source': 'wwwlogin', 'utm_medium': 'crossdomain', } response = requests.get('https://app.dailypay.com/login', params=params, headers=headers) # Regex to extract the part after '?' match = re.search(r'', response.text) if not match: print("No scriptID found") exit(0) script_id = match.group(1) print( get( "https://castle.takionapi.tech/generate", params={ "scriptID": script_id, }, headers={ "x-api-key": "TAKION_XXXX", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/127.0.0.0", "sec-ch-ua": '"Google Chrome";v="127", "Chromium";v="127", "Not:A-Brand";v="99"' } ).json() ) ``` -------------------------------- ### Authenticate with and without NuData headers in Python Source: https://docs.takionapi.tech/nudata/examples Compares a standard POST request to Ticketmaster authentication against one that includes a dynamically generated 'nds-pmd' header from the NuData service. ```python import requests API_KEY = "" def test_without_nudata(): return requests.post( "https://auth.ticketmaster.com/json/sign-in", json={ "email": "exampleuser@gmail.com", "password": "example!", "rememberMe": False, "externalUserToken": None }, headers={ "accept": "*/*", "accept-language": "en-us", "content-type": "application/json", # "nds-pmd": , We are not passing nudata header "origin": "https://auth.ticketmaster.com", "priority": "u=1, i", "referer": "https://auth.ticketmaster.com/as/authorization.oauth2?client_id=8bf7204a7e97.web.ticketmaster.us&response_type=code&scope=openid%20profile%20phone%20email%20tm&redirect_uri=https://identity.ticketmaster.com/exchange&visualPresets=tm&lang=en-us&placementId=mytmlogin&hideLeftPanel=false&integratorId=prd1741.iccp&intSiteToken=tm-us&TMUO=east_Yy+wr1Nf+xmww4O9ewBePc8SMn3/TKSDNBl6qJi7Lxk=&deviceId=xgSNBg0DvDU3NDc6OjY2Njo9Mz1i4D%2FZ9cE4fQ&doNotTrack=true", "sec-ch-ua": '"Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"macOS\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "tm-client-id": "8bf7204a7e97.web.ticketmaster.us", "tm-integrator-id": "prd1741.iccp", "tm-oauth-type": "tm-auth", "tm-placement-id": "mytmlogin", "tm-site-token": "tm-us", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" } ) def test_with_nudata(): nudata_header = requests.get( "https://nudata.takionapi.tech/generate", params={ "url": "https://nudata.ticketmaster.com/2.2/w/w-481390/sync/js/", "api_key": API_KEY } ).json()["result"] return requests.post( "https://auth.ticketmaster.com/json/sign-in", json={ "email": "exampleuser@gmail.com", "password": "example!", "rememberMe": False, "externalUserToken": None }, headers={ "accept": "*/*", "accept-language": "en-us", "content-type": "application/json", "nds-pmd": nudata_header, # We are passing nudata header "origin": "https://auth.ticketmaster.com", "priority": "u=1, i", "referer": "https://auth.ticketmaster.com/as/authorization.oauth2?client_id=8bf7204a7e97.web.ticketmaster.us&response_type=code&scope=openid%20profile%20phone%20email%20tm&redirect_uri=https://identity.ticketmaster.com/exchange&visualPresets=tm&lang=en-us&placementId=mytmlogin&hideLeftPanel=false&integratorId=prd1741.iccp&intSiteToken=tm-us&TMUO=east_Yy+wr1Nf+xmww4O9ewBePc8SMn3/TKSDNBl6qJi7Lxk=&deviceId=xgSNBg0DvDU3NDc6OjY2Njo9Mz1i4D%2FZ9cE4fQ&doNotTrack=true", "sec-ch-ua": '"Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"macOS\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "tm-client-id": "8bf7204a7e97.web.ticketmaster.us", "tm-integrator-id": "prd1741.iccp", "tm-oauth-type": "tm-auth", "tm-placement-id": "mytmlogin", "tm-site-token": "tm-us", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36" } ) if __name__ == "__main__": print("Response without nudata header:", test_without_nudata().status_code) response = test_with_nudata() print("Response with nudata header:", response.status_code, " / ", response.json()) ``` -------------------------------- ### Solve Geetest v3 Captcha Source: https://docs.takionapi.tech/geetest/examples Uses the requests library to fetch challenge details and submit them to the Takion v3 endpoint. ```python from requests import get, post from time import time API_KEY = "TAKION_API_XXXX" def load_geetestv3(challenge_type: str): if challenge_type.lower() not in ["slide", "icon"]: print(f"Invalid challenge '{challenge_type}") return False url = f'https://www.geetest.com/demo/gt/register-en{challenge_type.capitalize()}-official?t={time() * 1000}' return get(url).json() def solve_geetest(challange, gt): params = { "challenge": challange, "gt": gt, "api_key": API_KEY } url = "https://geetest.takionapi.tech/v3" return get(url, params=params).json() if __name__ == '__main__': for challenge in ["slide", "icon"]: print(f"Loading {challenge} challenge...") challenge_details = load_geetestv3(challenge) print(f"Solving... {challenge_details['challenge']}") response = solve_geetest(challenge_details['challenge'], challenge_details['gt']) print(f"Response: {response}") ``` -------------------------------- ### Solve Incapsula Challenge with Python Source: https://docs.takionapi.tech/incapsula/examples Uses the requests library to detect an Incapsula challenge, solve it via the Takion API, and apply the resulting cookie to the session. ```python from requests import Session, post from re import search def is_challenge(response): pattern = r'src="(/_Incapsula_Resource\?[^"]+)"' match = search(pattern, response.text) return f"https://{response.url.split('/')[2]}/{match.group(1)}" if match else False if __name__ == "__main__": API_KEY = "TAKION_API_XXX" # Your api key here session = Session() url = "https://tickets.rolandgarros.com/fr/" headers = { 'Host': 'tickets.rolandgarros.com', 'cache-control': 'max-age=0', 'sec-ch-ua': '"Google Chrome";v="112", "Chromium";v="112", "Not?A_Brand";v="24"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'sec-fetch-site': 'none', 'sec-fetch-mode': 'navigate', 'sec-fetch-user': '?1', 'sec-fetch-dest': 'document', 'accept-language': 'en-GB,en;q=0.9', } response = session.get(url, headers=headers) if not (challenge_url := is_challenge(response)): print("Page loaded successfully") exit(0) print(f"Found challenge, solving...") # Load challenge challenge = session.get(challenge_url, headers={ 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' }) # Solve the challenge takion_response = post( f"https://incapsula.takionapi.tech/utmvc?api_key={API_KEY}", json={ "content": challenge.text, "cookies": [[name, value] for name, value in session.cookies.items()] }, headers={ 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' } ).json() if (error := takion_response.get("error")): print(f"Error: {error}") exit(1) # Set the utmvc cookie utmvc = takion_response["___utmvc"] session.cookies.set("___utmvc", utmvc) print(f"Got cookie: {utmvc[:15]}...{utmvc[-15:]}") # Now we send the original request again response = session.get(url, headers=headers) print(f"Challenge {'' if is_challenge(response) else 'not '}found using cookie") ``` -------------------------------- ### Solve Geetest v4 Captcha Source: https://docs.takionapi.tech/geetest/examples Submits a captcha ID and kind to the Takion v4 endpoint to retrieve a solution. ```python from requests import get, post from time import time API_KEY = "TAKION_API_XXXX" def solve_geetest(captcha_id, kind): params = { "captcha_id": captcha_id, "kind": kind, "api_key": API_KEY } url = "https://geetest.takionapi.tech/v4" return get(url, params=params).json() if __name__ == '__main__': for challenge in ["slide", "ai"]: print(f"Solving {challenge} challenge...") response = solve_geetest( "fcd636b4514bf7ac4143922550b3008b", challenge ) print(f"Response: {response}") ```