{"openapi":"3.1.0","info":{"title":"PredictHQ (BYOK) API","version":"0.1.0","description":"PredictHQ (BYOK) lets an AI assistant read your own PredictHQ data through the PredictHQ API with a key you supply (PredictHQ access token). Read-only: 6 tools (search_events, find_events_near, get_events_by_id, count_events, search_places, get_place_hierarchies). The BYOK key travels with each request, is used for that one call only and is never stored, logged or cached; it is only ever sent to...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-predicthq.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-predicthq/docs"},"termsOfService":"https://connectorbay.com/byok-predicthq/terms"},"servers":[{"url":"https://byok-predicthq.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-predicthq/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/search_events":{"post":{"operationId":"search_events","summary":"Search events by text, category, country, place, date range and rank, with attendance and location. Results are limited ","description":"Search events by text, category, country, place, date range and rank, with attendance and location. Results are limited to the locations and dates in your subscription. Use for \"What are the biggest concerts in the US in December 2026\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"q":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Full-text search, for example 'katy perry'.","title":"Q"},"category":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated categories: academic, school-holidays, public-holidays, observances, politics, conferences, expos, concerts, festivals, performing-arts, sports, community, daylight-savings, airport-delays, severe-weather, disasters, terror, health-warnings.","title":"Category"},"country":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated two-letter country codes, for example 'US,CA'.","title":"Country"},"start_gte":{"anyOf":[{"maxLength":25,"type":"string"},{"type":"null"}],"default":null,"description":"Events starting on or after this date, YYYY-MM-DD or YYYY-MM-DDThh:mm:ss.","title":"Start Gte"},"start_lte":{"anyOf":[{"maxLength":25,"type":"string"},{"type":"null"}],"default":null,"description":"Events starting on or before this date, YYYY-MM-DD or YYYY-MM-DDThh:mm:ss.","title":"Start Lte"},"active_gte":{"anyOf":[{"maxLength":25,"type":"string"},{"type":"null"}],"default":null,"description":"Events active on or after this date (overlapping the range), YYYY-MM-DD.","title":"Active Gte"},"active_lte":{"anyOf":[{"maxLength":25,"type":"string"},{"type":"null"}],"default":null,"description":"Events active on or before this date (overlapping the range), YYYY-MM-DD.","title":"Active Lte"},"rank_level":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated PHQ Rank levels 1 to 5 (5 is the largest events).","title":"Rank Level"},"sort":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated sort fields, prefix - for descending: start, end, rank, local_rank, phq_attendance, title, updated, predicted_event_spend. Default -start.","title":"Sort"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many events to return (1 to 100, default 10).","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of events to skip, for paging.","title":"Offset"}},"title":"search_eventsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/find_events_near":{"post":{"operationId":"find_events_near","summary":"Find events inside a radius around a point, optionally limited by category and dates. Use for \"What events are within 5 ","description":"Find events inside a radius around a point, optionally limited by category and dates. Use for \"What events are within 5 km of downtown Chicago next week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"within":{"description":"Radius and center, for example '5km@41.8781,-87.6298'; unit m, km, ft or mi.","maxLength":60,"title":"Within","type":"string"},"category":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated categories: academic, school-holidays, public-holidays, observances, politics, conferences, expos, concerts, festivals, performing-arts, sports, community, daylight-savings, airport-delays, severe-weather, disasters, terror, health-warnings.","title":"Category"},"active_gte":{"anyOf":[{"maxLength":25,"type":"string"},{"type":"null"}],"default":null,"description":"Events active on or after this date (overlapping the range), YYYY-MM-DD.","title":"Active Gte"},"active_lte":{"anyOf":[{"maxLength":25,"type":"string"},{"type":"null"}],"default":null,"description":"Events active on or before this date (overlapping the range), YYYY-MM-DD.","title":"Active Lte"},"rank_level":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated PHQ Rank levels 1 to 5 (5 is the largest events).","title":"Rank Level"},"sort":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated sort fields, prefix - for descending: start, end, rank, local_rank, phq_attendance, title, updated, predicted_event_spend. Default -start.","title":"Sort"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many events to return (1 to 100, default 10).","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of events to skip, for paging.","title":"Offset"}},"required":["within"],"title":"find_events_nearArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_events_by_id":{"post":{"operationId":"get_events_by_id","summary":"Fetch specific events by their IDs (comma-separated). Use for \"Show PredictHQ event z13B3870YOgv\".","description":"Fetch specific events by their IDs (comma-separated). Use for \"Show PredictHQ event z13B3870YOgv\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"description":"Comma-separated PredictHQ event IDs, for example 'z13B3870YOgv'.","maxLength":200,"title":"Id","type":"string"}},"required":["id"],"title":"get_events_by_idArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/count_events":{"post":{"operationId":"count_events","summary":"Count events matching the filters, with breakdowns by category, rank level and label, and the highest rank. Use for \"How","description":"Count events matching the filters, with breakdowns by category, rank level and label, and the highest rank. Use for \"How many sports events happen in London in June 2026, by category\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"q":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Full-text search, for example 'katy perry'.","title":"Q"},"category":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated categories: academic, school-holidays, public-holidays, observances, politics, conferences, expos, concerts, festivals, performing-arts, sports, community, daylight-savings, airport-delays, severe-weather, disasters, terror, health-warnings.","title":"Category"},"country":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated two-letter country codes, for example 'US,CA'.","title":"Country"},"place_scope":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated PredictHQ place IDs or airport codes (IATA, ICAO) to search events within.","title":"Place Scope"},"within":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Radius and center, for example '10km@40.7128,-74.0060'; unit m, km, ft or mi.","title":"Within"},"active_gte":{"anyOf":[{"maxLength":25,"type":"string"},{"type":"null"}],"default":null,"description":"Events active on or after this date, YYYY-MM-DD.","title":"Active Gte"},"active_lte":{"anyOf":[{"maxLength":25,"type":"string"},{"type":"null"}],"default":null,"description":"Events active on or before this date, YYYY-MM-DD.","title":"Active Lte"},"rank_level":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated PHQ Rank levels 1 to 5 (5 is the largest events).","title":"Rank Level"}},"title":"count_eventsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/search_places":{"post":{"operationId":"search_places","summary":"Search places (countries, regions, cities, neighbourhoods) by name, country or coordinates to get place IDs usable as ev","description":"Search places (countries, regions, cities, neighbourhoods) by name, country or coordinates to get place IDs usable as event filters. Use for \"What is the PredictHQ place ID of New York\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"q":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Place name to search for, for example 'New York'.","title":"Q"},"country":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated two-letter country codes.","title":"Country"},"type":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated place types: planet, continent, country, region, county, localadmin, locality, neighbourhood, major, metro, local.","title":"Type"},"location":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"A coordinate in the form '@latitude,longitude', for example '@40.66677,-73.88236'.","title":"Location"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many places to return (1 to 100).","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of events to skip, for paging.","title":"Offset"}},"title":"search_placesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_place_hierarchies":{"post":{"operationId":"get_place_hierarchies","summary":"Get the chain of places (country, region, county, city) that contain a place or coordinate, as place IDs. Use for \"Which","description":"Get the chain of places (country, region, county, city) that contain a place or coordinate, as place IDs. Use for \"Which region and country contain place 5128581\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"location_place_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated place IDs to look up.","title":"Location Place Id"},"location_origin":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"A coordinate in the form 'latitude,longitude' (use instead of a place ID).","title":"Location Origin"},"level":{"anyOf":[{"enum":["planet","continent","country","region","county","localadmin","locality","neighbourhood"],"type":"string"},{"type":"null"}],"default":"locality","description":"Administrative level to return: planet, continent, country, region, county, localadmin, locality, neighbourhood.","title":"Level"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many chains to return (1 to 100).","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of events to skip, for paging.","title":"Offset"}},"title":"get_place_hierarchiesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}