Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

14 Commits

Repository files navigation

track availability of tickets for events from ticketmaster.co.uk

How it works

  1. open new tab for ticketmaster.co.uk in running Mozilla Firefox instance
  2. retrieve ticketmaster.co.uk cookies from running instance
  3. call Ticketmaster API
  4. write response to /logs/tracking_history.csv, /logs/tracking_history.jsonl and /logs/data.db
  5. if ticket is available, response with ticket details will be written to /logs/picks.json
  6. if ticket under price limit from config.json is available, alert sound rings and new tab to event pops up
  7. when cookies expire after about 15 Minutes, start from beginning

Requirements

Get Started

  1. install requirements pip install -r requirements.txt
  2. setup config.json (sample can be found here sample.config.json)
  3. setup init.json (sample can be found here sample.init.sql)

Ticketmaster API

API to retrieve list of available tickets of an event

Endpoint

/api/quickpicks/<EVENT_ID>/list

URL Parameters

NameValueDescription
EVENT_ID23006130DAB40C0BID of Event

How to get Event ID

  1. search for Event on ticketmaster.co.uk (e.g. https://www.ticketmaster.co.uk/coldplay-tickets/artist/806431)
  2. go to Ticket Site (e.g. https://www.ticketmaster.co.uk/coldplay-music-of-the-spheres-world-london-22-08-2025/event/23006130DAB40C0B)
  3. get Event ID (e.g. 23006130DAB40C0B) from URL

GET Parameters

NameValueDescription
resaletrueif true, only resale tickets will be returned
qty1number of tickets you're looking for
offset0position from where to start returning results
limit100number of maxium returned results
sortpriceattribute to sort results
primarytruen/a
defaultToOnetruen/a
tids000000000004n/a

Request Headers

see sample.config.json

Cookies

Required

NameDomain
BID.ticketmaster.co.uk
eps_sid.ticketmaster.co.uk
language.ticketmaster.co.uk
reese84.ticketmaster.co.uk

Others

NameDomain
Queue-itqueue.ticketmaster.co.uk
cf_clearance.help.ticketmaster.co.uk
ma.did.identity.ticketmaster.co.uk

Response

HTTP Status Codes

StatusDescriptonHow Tracker handles it
200Request successfulwrite response to logs\<EVENT_ID>.csv
401Cookie expiredwrite status to logs\<EVENT_ID>.csv, retrieve new cookie
403Headers invalidwrite error to logs\<EVENT_ID>.html, cancel execution
404Event not foundwrite error to logs\<EVENT_ID>.html, cancel execution
503Event temporarily not availablereplace failing event id with new event id
504Timeoutreplace failing event id with new event id

Body when no Ticket is available

{
"quantity": 0,
"total": 0,
"picks": [],
"descriptions": []
}

Body when 1 Ticket is available

{
"quantity": 1,
"eventId": "23006113B5E30BFD",
"total": 1,
"picks": [
{
"id": "lg899kjn6",
"type": "general-seating",
"section": "PITCH",
"originalPrice": 396.93,
"description": "",
"areaName": "",
"placeDescriptionId": "IE5DCNJMHE",
"hasSpecialDescription": false,
"offerIds": [
"HF6GYZZYHE4WW2TOGY"
],
"snapshotImageUrl": "image?systemId=HOST_UK&segmentIds=s_168",
"quality": 0.97235,
"sellerBusinessType": "private",
"resaleListingId": "lg899kjn6",
"sellerAffiliationType": "unaffiliated",
"attributes": []
}
],
"descriptions": [
{
"id": "IE5DCNJMHE",
"descriptions": [
"No U14s. Under 18s with adult 18+",
"Incl. 2.75 Facility Fee"
]
}
]
}

Subdomains

Schema tracking_history.csv

uses CSV Format

each line represents the availability at the given time

Sample:

quantitytotalpicksdescriptionsstatuseventIdtimedate
00[][]20023006130DAB40C0B23:59:5901.01.2024

Schema tracking_history.jsonl

uses JSON Lines Format

each line represents the availability at the given time

Sample:

{"quantity": 0, "total": 0, "picks": [], "descriptions": [], "status": 200, "eventId": "23006130DAB40C0B", "isoDate": "2024-01-01T23:59:59.999999"}

Schema picks.json

uses JSON Format

each object represents unique available pick for a single event at the given time

Sample:

{
"picks": [
{
"id": "lwchvgnt4",
"type": "general-seating",
"section": "PITCH",
"originalPrice": 395.42,
"description": "",
"areaName": "",
"placeDescriptionId": "IE5DCNJMHE",
"hasSpecialDescription": false,
"offerIds": [
"HF6GY53DNB3GO3TUGQ"
],
"snapshotImageUrl": "image?systemId=HOST_UK&segmentIds=s_168",
"quality": 0.97235,
"sellerBusinessType": "private",
"resaleListingId": "lwchvgnt4",
"sellerAffiliationType": "unaffiliated",
"attributes": [],
"eventId": "23006130DAB40C0B",
"isoDate": "2024-01-01T23:59:59.999999"
},
{
"id": "lwhdbh7jv",
"type": "seat",
"section": "120",
"row": "24",
"seatFrom": "243",
"seatTo": "244",
"originalPrice": 540.18,
"description": "Level 1",
"areaName": "L1",
"placeDescriptionId": "IE5DCNRMHE",
"hasSpecialDescription": false,
"offerIds": [
"HF6GY53IMRRGQN3KOY"
],
"snapshotImageUrl": "image?systemId=HOST_UK&sectionNames=120&placeId=GEZDAORSGQ5DENBU",
"quality": 0.88172,
"sellerBusinessType": "private",
"resaleListingId": "lwhdbh7jv",
"sellerAffiliationType": "unaffiliated",
"attributes": [],
"eventId": "23006130DAB40C0B",
"isoDate": "2024-01-01T23:59:59.999999"
}
]
}

SQLite Database

events, logs, picks and cookies are all written in SQLite database logs\data.db

Initialization

init.sql creates data.db database and all required tables (events, cookies, logs, picks). Also it inserts all relevant information about events (ID, Artist, City, Vanue, Date)

ER Diagram

database schema

generated with dbeaver

Configuration

create config.json with following attributes:

NameDescriptionAvailable Values
firefox_executableabsolute path to Mozialla Firefox executablen/a
seleniumNOT IMPLEMENTED YET!chrome, firefox
cookiesCookie String or cookies.txt File, if empty Cookie from running Firefox instance will be usedString: "eps_sid=XXX; BID=XXX; reese84=XXX; SID=XXX; sticky=XXX", File: sample.cookies.txt
headersArray of required Request Headerssee sample.config.json
domainTicketmaster domain.ticketmaster.co.uk
api_pathAPI path/api/quickpicks/
primary_eventsArray of Event IDs which will be trackedsee sample.config.json
secondary_eventsArray of Event IDs which will be used if primary Event failssee sample.config.json
methodAPI method incl. query parameterslist?resale=true&qty=1&offset=0&limit=100&sort=price
request_delaydelay between requests (in seconds)30
refresh_delaydelay until new loaded cookies will be used (in seconds)15
price_limitprice limit for ticket alerte.g. 500.00
response_sampleload API response sample for testingsee list_ticket.json

for further sample values see sample.config.json

Console Output

console output

Line 1: Execution Time (hh:mm:ss) HTTP Status
Line 2: Current Event ID
Line 3: Number for Events which returned HTTP 503 or 504
Line 4 - 12: Table of used Cookies including Name, Expiration (hh:mm:ss dd.MM.YYYY) and Domain
Last Line: Countdown until the Execution continues

Testing

Scripts

curl.bat - basic cURL command of sample request from Chrome Dev Tools

request_session.py - simple Python request sample with hardcoded headers and cookies

Load Response Sample

Load Cookie String

Load cookies.txt

To-Dos

  • bypass queue / add to basket
  • implement headless browser
    • selenium
    • playwright
  • add entries to cookies_per_log table
  • Exception Hanlding / Error Logging
  • add UI to view results

Ticketmaster Troubleshooting

ErrorReasonSolution
Let's Get Your Identity Verifiedmalicious browsing behaviorresolve captcha
Your Session Has Been Suspendedtoo many requestsautomatically unsupended by ticketmaster after about 30 days
Pardon the Interruptionmalicious browsing behaviorn/a

About

track availability of tickets for events from ticketmaster.co.uk

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages