Skip to main content

Search API

The Search API provides unified search across competitors, battlecards, and intel items in your workspace.

Search across competitors, battlecards, and intel items. Returns results grouped by type.

GET /api/search?q={query}

Query Parameters

  • q (string, required) - Search query (minimum 2 characters)

Response

{
"results": [
{
"type": "competitor",
"id": "competitor-id-1",
"title": "Acme Corp",
"subtitle": "https://acme.com",
"url": "/app/competitors/competitor-id-1",
"score": null
},
{
"type": "battlecard",
"id": "battlecard-id-1",
"title": "vs. Acme Corp",
"subtitle": "Kill shot description",
"url": "/app/battlecards/battlecard-id-1",
"score": null
},
{
"type": "intel",
"id": "intel-id-1",
"title": "Intel: Acme Corp",
"subtitle": "Intel item content preview...",
"url": "/app/intel?competitor=competitor-id-1&highlight=intel-id-1",
"score": null
}
]
}

Result Types

Results are returned in three types:

  1. competitor - Competitor companies matching the query
  2. battlecard - Battlecards with content matching the query
  3. intel - Intel items with content matching the query

Search Behavior

  • Competitors: Searches competitor names
  • Battlecards: Searches kill shot, landmines, pricing wedge, why we win, and why we lose content
  • Intel: Searches intel item content

Sorting

Results are sorted by relevance:

  1. Competitors first
  2. Battlecards second
  3. Intel items last

Limits

Results are limited to 20 items total.

Error Responses

  • 400 - Bad Request (query too short, less than 2 characters)
  • 401 - Unauthorized (invalid or missing API key)

Use Cases

  • Global Search: Provide unified search across all workspace content
  • Quick Navigation: Help users quickly find competitors, battlecards, or intel
  • Content Discovery: Discover relevant content based on search terms
  • Integration: Build search functionality into custom integrations

Performance Notes

  • Search is performed in-memory across all workspace data
  • For large workspaces, consider implementing pagination or server-side filtering
  • Search is case-insensitive and performs substring matching