Skip to main content

ticketfairy (Python)

The Python client for the Ticket Fairy API. Use it to:

  • read public event listings;
  • create events for a brand you manage;
  • read an event's sales;
  • copy another event's setup into an event, as a background job you can follow.

It has no dependencies outside the Python standard library and needs Python 3.9 or later.

pip install ticketfairy

The same API is available from Node.js and the command line in the ticketfairy npm package.

Public event listings

The public listing needs no account.

from ticketfairy import TicketFairy

tf = TicketFairy()

page = tf.events.list(country="GB", date_from="2026-11-01", size=50)
for event in page["events"]:
    print(event["displayName"], event["startDate"], event["url"])

# Every matching event, page after page:
for event in tf.events.iter(search="jazz", limit=200):
    print(event["displayName"])

list takes these filters:

Filter Meaning
search Words to match against event names and descriptions
country An ISO 3166-1 alpha-2 country code
state A region, state or province
date_from, date_to Dates as YYYY-MM-DD
section_type The listing section to read
timezone An IANA timezone for the date window
sort created_at, updated_at or start_date
order asc or desc
brand_id Only events from this brand
include The kinds of event to include
size Events per page, up to 200

iter takes the same filters and follows pagination.nextCursor for you.

Organiser API

The organiser API acts as you. To get a token:

  1. Create a personal access token in your Ticket Fairy account settings.
  2. Pass it to the client, or set it in the TICKETFAIRY_TOKEN environment variable.

The token can do what your roles allow, and nothing more.

from ticketfairy import TicketFairy

org = TicketFairy(token="...")  # or set TICKETFAIRY_TOKEN

# Create a draft event for a brand where you are admin or owner.
event = org.events.create(
    brand_id=1234,
    attributes={"displayName": "Summer Festival 2027", "slug": "summer-festival-2027", "flagDraft": True},
)
print(event["id"])

# Tickets sold and revenue, by day and by ticket type and release.
sales = org.events.sales(event["id"])

create sends an Idempotency-Key with each request. If a network error happens, a retry cannot create a second event.

Copy another event's setup

The copy runs in the background. start returns at once with the run. wait follows the run until it stops.

run = org.setup_copy.start(new_event_id, source_event_id=last_year_event_id)
run = org.setup_copy.wait(new_event_id, run, timeout=600)

print(run["status"])  # done, partly_done or failed
for part in run["parts"]:
    print(part)

How a copy works:

  • Both events must belong to the same brand.
  • You need the owner, admin or producer role on both events.
  • Forms need the owner or admin role.
  • Leave out parts to copy everything, or name the parts you want.

start sends a request_key. Sending the same key and the same choice of parts again returns the same run, so a retried start does not copy twice.

Errors

Every error is a TicketFairyError. Each error has these attributes:

  • status: the HTTP status.
  • code: a stable code, when the API sends one.
  • message: the API's own explanation.
  • hint: what to do next, when the API says.
  • body: the response.
Error When
AuthenticationError The token is missing, expired or revoked
PermissionDeniedError Your role does not allow this
NotFoundError No such event or run
ValidationError A parameter or field is not valid; the message names it
ConflictError A key was already used for something else, or a copy is already running
RateLimitedError Too many requests; wait retry_after seconds
ServerError Ticket Fairy could not complete the request
NetworkError No response arrived
SetupCopyTimeoutError wait gave up while the copy was still running; the copy carries on

When the client retries

Reads are retried after a rate limit, a server error or a network error. For a rate limit, the client first waits for the Retry-After time.

Writes are retried in the same cases only when the API can tell a repeat from a new request. That is the case for create, which sends an Idempotency-Key, and for setup_copy.start, which sends a request_key. A repeat sends the same key, so it returns the first attempt's result rather than doing the work twice.

When the retries run out, the error is raised. A RateLimitedError carries retry_after.

API reference

The client follows these OpenAPI documents:

The developer guide is at ticketfairy.com/developers.

Metadata

Release files for ticketfairy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ticketfairy 0.1.1
File Size Uploaded
ticketfairy-0.1.1.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ticketfairy 0.1.1
File Interpreter ABI Platform
ticketfairy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / ticketfairy-0.1.1.tar.gz

Download URL ticketfairy-0.1.1.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dca7b51ca869b7d9d2f367a7dd46c3d263184e67184564ecfbc8e3b427eedeb1
BLAKE2b-256 checksum
How to use checksums
01bf3be519297d03bf04d81c4f911700c78cfd2e5ce47b09044ff0072688a86d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / ticketfairy-0.1.1-py3-none-any.whl

Download URL ticketfairy-0.1.1-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58ed0f6e45940e07cb6a244b2898e9031855854b233869e16bbb3cebd869c73e
BLAKE2b-256 checksum
How to use checksums
ae38e829f05af348357ece2782446470808bc2557c9ece0ebdaafd3331beec7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page