Inventory Status API
Learn to use Ticketmaster's Inventory Status API.
We'll cover the following
A ticketing service must provide information about the availability of tickets. Ticketmaster provides an Inventory Status API that we can use for this exact purpose.
Inventory status details
The Inventory Status API has a single endpoint—the availability endpoint—through which we can retrieve the status of the inventory for specified events.
The URL for this endpoint is:
https://app.ticketmaster.com/inventory-status/v1/availability
This endpoint takes a single query parameter, the details of which are as follows:
Parameter | Type | Category | Description |
| array[string] | required | An array of event IDs that we want the inventory status for. |
The response of an API call to this endpoint is in the form of an array of JSON objects, with each object corresponding to an event from the input events. The structure of a single object is as follows:
Property | Type | Description |
| string | The ID of the event. |
| string | The status of the inventory for the event. It can take the following values: |
| string | The status of the inventory for ticket resales. It can take the following values: |
The different values for the statuses are pretty self-explanatory, but let's take a look at their descriptions nonetheless:
TICKETS_AVAILABLE
: This status indicates that the inventory is available for purchase through primary channels.FEW_TICKETS_LEFT
: This status indicates that the inventory is limited.TICKETS_NOT_AVAILABLE
: This status indicates that the inventory is not available for purchase through primary channels.UNKNOWN
: This status indicates that the event ID is invalid or the inventory status is not available for the corresponding event.
Retrieve the inventory status
Let's make a call to this endpoint, once again using the event ID we've been using in previous lessons. You can try adding more event IDs in the events
list on line 5—just ensure that they are valid IDs!
import jsonimport requestsapikey = '{{API_KEY}}'events = ['{{EVENT_ID}}']response = requests.get('https://app.ticketmaster.com/inventory-status/v1/availability',params = {'apikey' : apikey,'events' : events}).json()print(json.dumps(response, indent=4))
The length of the response array is the same as the length of the events
list—each element of the response array corresponds to an input ID. We can match the outputs to the corresponding inputs using the eventId
property in the response objects.