Search content
Search
Search Content
Semantic search across sermons, scriptures, and series. By default returns all results in a single JSON response. When stream=true, returns a text/event-stream with these message types:
results— full results payload (same shape as the non-stream response)headline— streaming AI headline ({headline: string}appended incrementally)overview— streaming AI overview ({overview: string}appended incrementally)complete— final message; stream closeserror— error event; stream closes
GET
Search content
Using “Try It Out”: This endpoint requires a church-specific base URL. To test this endpoint:
- Click the server dropdown and select “Your church-specific Search API”
- Replace
{churchShortname}with your actual church shortname - Find your shortname in the Haystack Dashboard under Developer → API
https://gracechurch.thehaystack.ai/api, your shortname is gracechurch.Response Format
The search endpoint supports two response formats:Standard JSON Response (Default)
Fast, simple response with search results only. Best for most use cases.Streaming Response with AI Overview (Advanced)
For an AI-generated overview of results, add?stream=true to receive a Server-Sent Events stream. This feature is best suited for advanced integrations that need real-time AI summaries.
Server-Sent Events Implementation
Server-Sent Events Implementation
Event Types:Popular SSE Libraries:
results: Search results (same structure as JSON response)overview: Chunks of AI-generated summary as they’re generatedcomplete: Stream finished successfullyerror: An error occurred
- Python:
sseclient-py,aiohttp-sse-client - PHP:
mpociot/php-sse-client,artax/sse - Ruby:
celluloid-eventsource,sse-client - Node.js:
eventsource, built-infetchwith stream handling - Go:
r3labs/sse, standardhttppackage
Query Parameters
Natural-language search query
Available options:
embed, connect, console Required when surface=embed
Scope search to a single collection
When true, responds with Server-Sent Events streaming the AI overview as it is generated
Format hint for the AI overview
Response
Search results. Returns JSON by default, or Server-Sent Events stream when stream=true.

