Example Implementations

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)

Last updated