{
  "openapi": "3.1.0",
  "info": {
    "title": "NeedATicket live ticket prices",
    "version": "1.0.0",
    "description": "Today's cheapest listed resale ticket for upcoming US concerts, sport and theatre, recorded hourly from StubHub listings, with 30 days of price history. Read-only, no key needed. NeedATicket does not sell tickets: each event url is our event page, which links to the tickets on StubHub."
  },
  "servers": [
    {
      "url": "https://needaticket.net"
    }
  ],
  "paths": {
    "/prices.json": {
      "get": {
        "operationId": "getLiveTicketPrices",
        "summary": "Live lowest ticket prices for upcoming events",
        "description": "Find upcoming events by artist, event or venue name, city, dates and budget, with the cheapest ticket price right now. Use sort=low for prices well below what that event usually costs, and sort=drop for prices that fell this week.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Artist, event or venue name, or part of one. Case does not matter.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 60
            }
          },
          {
            "name": "city",
            "in": "query",
            "description": "City slug, lower case with hyphens, e.g. \"london\", \"manchester\", \"new-york\".",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Earliest event date, YYYY-MM-DD, in the event's local time.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Latest event date, YYYY-MM-DD, in the event's local time.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "max",
            "in": "query",
            "description": "Highest \"from\" price to include, in USD.",
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "price: cheapest first (default). drop: biggest fall over 7 days. soon: soonest first. low: only prices at least 40% below the event's usual price, biggest gap first.",
            "schema": {
              "type": "string",
              "enum": [
                "price",
                "drop",
                "soon",
                "low"
              ],
              "default": "price"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of events to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "where",
            "in": "query",
            "description": "home: US events only (default). all: every country, US first.",
            "schema": {
              "type": "string",
              "enum": [
                "home",
                "all"
              ],
              "default": "home"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching events. An empty list means nothing upcoming matched, not an error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricesResponse"
                }
              }
            }
          },
          "400": {
            "description": "An option was not understood; the error says which and what it accepts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Price data is briefly unavailable; try again shortly."
          }
        }
      }
    },
    "/travel.json": {
      "get": {
        "operationId": "getEventTravel",
        "summary": "Nearest stations and live line status for an event or venue",
        "description": "Getting to a show: the nearest stations to the venue, the lines serving them and Transport for London's status for each line now and on the event day (planned closures included). London venues only for now; elsewhere travel is null with a note. Ticket prices and links are on eventUrl.",
        "parameters": [
          {
            "name": "event",
            "in": "query",
            "description": "Event slug, as in /events/<slug>.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "venue",
            "in": "query",
            "description": "Venue slug, as in /venues/<slug>. Pass event or venue, not both.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The event or venue, and its travel data (null when we have none).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Neither or both of event and venue given, or a malformed slug."
          },
          "404": {
            "description": "No event or venue with that slug."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PricesResponse": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventPrice"
            }
          }
        },
        "required": [
          "generatedAt",
          "count",
          "events"
        ]
      },
      "EventPrice": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "performer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Main act."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Our event page, which links to the tickets."
          },
          "startDate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Event day, YYYY-MM-DD, local time.",
            "format": "date"
          },
          "startDateLabel": {
            "type": "string"
          },
          "venue": {
            "type": [
              "string",
              "null"
            ],
            "description": "Venue name."
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "description": "City name."
          },
          "citySlug": {
            "type": [
              "string",
              "null"
            ],
            "description": "Value to pass as city."
          },
          "countryCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 alpha-2."
          },
          "lowPrice": {
            "type": "number",
            "description": "Cheapest listed ticket, per ticket, before the seller's fees."
          },
          "priceCurrency": {
            "type": "string"
          },
          "priceLabel": {
            "type": "string",
            "description": "lowPrice formatted for display."
          },
          "priceCheckedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When lowPrice was last seen in StubHub's hourly listings.",
            "format": "date-time"
          },
          "low30Days": {
            "type": [
              "number",
              "null"
            ],
            "description": "Lowest price in the last 30 days, when different from today's."
          },
          "dropPct7Days": {
            "type": [
              "number",
              "null"
            ],
            "description": "Percentage fall against 7 days ago."
          },
          "usualPrice": {
            "type": [
              "number",
              "null"
            ],
            "description": "Median of the event's daily lowest prices over up to 30 days."
          },
          "belowUsualPct": {
            "type": [
              "number",
              "null"
            ],
            "description": "How far lowPrice is below usualPrice, in percent."
          },
          "unusuallyLow": {
            "type": "boolean",
            "description": "lowPrice is at least 40% below usualPrice."
          },
          "lowPriceSince": {
            "type": [
              "string",
              "null"
            ],
            "description": "When StubHub's listings first showed this low price.",
            "format": "date-time"
          },
          "artistDateRank": {
            "type": [
              "object",
              "null"
            ],
            "description": "Where this date's price sits among the same act's priced upcoming dates; rank 1 is the cheapest.",
            "properties": {
              "rank": {
                "type": "integer"
              },
              "of": {
                "type": "integer"
              }
            }
          },
          "clickedToBuy14Days": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Different people who went from our pages to the tickets in the last 14 days (shown from 3)."
          }
        },
        "required": [
          "name",
          "url",
          "lowPrice",
          "priceCurrency",
          "unusuallyLow"
        ]
      }
    }
  }
}