# StubHub Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/stubhub/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 1 credit per call | | **Documentation** | https://www.piloterr.com/library/stubhub-search | ## Description Search StubHub events by keyword or by a StubHub search URL. The response is the first embedded page. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/stubhub/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Harlem Globetrotters, Marseille ```json { "results": [ { "id": "162387399", "url": "https://www.stubhub.com/harlem-globetrotters-marseille-tickets-3-31-2027/event/162387399/", "date": "Mar 31 2027", "name": "Harlem Globetrotters", "time": "7:00 PM", "year": "2027", "price": null, "country": "France", "currency": null, "start_at": null, "venue_city": "Marseille", "venue_name": "Palais des Sports de Marseille", "day_of_week": "Wed", "country_code": "FR", "price_display": null, "venue_location": "Marseille, France", "is_parking_event": false, "has_active_listings": true } ], "pagination": { "next": null, "page": 1, "per_page": 20, "total_pages": null, "total_results": 2171 } } ``` ## Documentation ## Overview Search events on StubHub. A keyword such as `nba` calls `https://www.stubhub.com/secure/search/?q=nba`. A StubHub search URL is also accepted. The response is `{ results, pagination }` with the event name, venue, city, date, and time. Search cards do not print a ticket price, so `price`, `price_display`, and `currency` are null. Send `results[].url` to `/v2/stubhub/event` for the lowest printed price. The search document embeds one page of about 20 events. `pagination.page` is 1, `per_page` is 20, and `total_results` is the count StubHub reports. It changes from day to day. `total_pages` and `next` are null, because a later `pageIndex` URL repeats the same 20 events. `page=2` returns 404. ## Quickstart ``` GET https://api.piloterr.com/v2/stubhub/search?query=nba ``` ``` GET https://api.piloterr.com/v2/stubhub/search?query=concert ``` Use `results[].url` with `/v2/stubhub/event`. The event id matches `results[].id`. ## Parameters | Parameter | Required | Example | |---|---|---| | `query` | yes | `nba` | | `page` | no | `1` | `query` is a keyword or a StubHub search URL. An event URL (`/event/`) is rejected here. `page` is optional and starts at 1. Only page 1 returns events. Page 2 and above return 404. ## Response fields | Field | Type | Meaning | |---|---|---| | `results[].id` | string | Event id | | `results[].url` | string | Event URL | | `results[].name` | string | Event name | | `results[].venue_name` | string or null | Venue | | `results[].venue_city` | string or null | City | | `results[].venue_location` | string or null | City and country line | | `results[].country` | string or null | Country | | `results[].country_code` | string or null | Country code, such as `FR` | | `results[].date` | string or null | Date label, such as `Mar 31 2027` | | `results[].time` | string or null | Time label, such as `7:00 PM` | | `results[].day_of_week` | string or null | Weekday | | `results[].year` | string or null | Year | | `results[].start_at` | string or null | Start timestamp when the card has one | | `results[].has_active_listings` | boolean or null | True when listings are active | | `results[].is_parking_event` | boolean or null | True for a parking-only event | | `results[].price` | null | Not printed on search cards | | `results[].price_display` | null | Not printed on search cards | | `results[].currency` | null | Not printed on search cards | | `pagination.page` | integer | `1` | | `pagination.per_page` | integer | `20` | | `pagination.total_results` | integer or null | StubHub's reported total | | `pagination.total_pages` | null | Later pages are not in the document | | `pagination.next` | null | No further fetchable page | ## Pagination Ids are unique on the returned page. `next` is null. That means there is no further page to request: `page=2` is 404, and it does not repeat page 1 under another page number. `total_results` remains the full count StubHub prints, so you can see the size of the catalog even though only the embedded page is returned. A broad keyword such as `nba` follows StubHub's own ranking and can place an exhibition ahead of a league game. ## Use cases - A tour desk lists the embedded NBA events with venue, city, and date, then opens each URL for a price. - An operations filter keeps rows where `is_parking_event` is false. - A market scan stores `total_results` for `concert` and treats `results` as the fetchable first page. ## Error codes | Code | Meaning | |---|---| | `400` | Empty query, a host other than stubhub.com, or an event URL sent to search | | `401` | Missing API key | | `404` | No events, or `page` greater than 1 | | `500` | The fetch failed | ## Related endpoints [StubHub Event](https://www.piloterr.com/library/stubhub-event)