Skip to content

Search Breakout Topics

v1.0.0
OpenAPI 3.1.0

Upriver API

A social insights API for ad generation platforms. It provides structured signals, like psychographics, behavioral insights, trends, and audience language, to help AI models generate relevant, higher-converting ads.

Server:https://api.upriver.ai

Production API server

Client Libraries

Search Breakout Topics

Search breakout topics using hybrid vector + keyword search.

Supports three search modes:

  • vector: Semantic similarity search using embeddings
  • keyword: Full-text search using PostgreSQL tsvector
  • hybrid: Combined vector and keyword search (default)
Body·SearchTopicsRequest
required
application/json

Request for searching breakout topics.

  • query
    Type: string · Query
    min length:  
    1
    required

    Search query text

  • feed
    Type: string · Feednullable

    Entitled private feed whose Breakout topics should be searched.

  • vertical
    Type: string · Verticalnullable

    Filter by vertical (e.g., 'sports')

  • mode
    Type: string · SearchModeenum

    Search mode: vector, keyword, hybrid

    values
    • vector
    • keyword
    • hybrid
  • surface_mode
    Type: string · ListSurfaceModeenum

    Return raw topics or deduped derived story surfaces

    values
    • topic
    • story
  • limit
    Type: integer · Limit
    min:  
    1
    max:  
    100

    Maximum number of results. Requesting more than 20 results requires a credits-based plan.

  • include
    Type: array string[] · Includeenum

    Optional expansions to include in the response. Allowed values: citations, entities. Example: ["citations", "entities"]

    values
    • citations
    • entities
  • include_citations
    Type: boolean · Include Citations

    Deprecated: use include=["citations","entities"] instead.

  • query_context
    Type: object · SearchQueryContextnullable

    Optional source-aware context for query rewriting. Useful for terse external prompts such as Kalshi markets.

  • kalshi_event_url
    Type: string · Kalshi Event Url
    max length:  
    500
    nullable

    Optional Kalshi event URL or ticker. When provided, the server resolves event metadata and uses it for query planning. Mutually exclusive with query_context.

  • citation_sources
    Type: array string[] | null · Citation Sourcesenumnullable

    Restrict returned citations to these source categories (news, reddit, twitter). Omit for all sources. Only applies when surface_mode=topic.

  • llm_relevance
    Type: boolean · Llm Relevance

    Enable enhanced relevance scoring for search results. When true, results are scored and re-ranked by how well they match the query intent.

Responses
  • application/json
  • application/json
Request Example for post/v1/topics/breakout/search
curl https://api.upriver.ai/v1/topics/breakout/search \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: YOUR_SECRET_TOKEN' \
  --data '{
  "query": "",
  "feed": "",
  "vertical": "",
  "mode": "hybrid",
  "surface_mode": "topic",
  "limit": 20,
  "include": [
    "citations"
  ],
  "include_citations": false,
  "query_context": {
    "source": "",
    "series_title": "",
    "market_subtitle": "",
    "competition": "",
    "competition_scope": "",
    "contract_tickers": [
      ""
    ],
    "contract_titles": [
      ""
    ],
    "contract_subtitles": [
      ""
    ]
  },
  "kalshi_event_url": "",
  "citation_sources": [
    "news"
  ],
  "llm_relevance": true
}'
{
  "surface_mode": "topic",
  "topics": [
    {
      "topic_id": "string",
      "topic_name": "string",
      "vertical": "string",
      "category": "string",
      "status": "string",
      "score": 1,
      "relevance_score": 1,
      "engagement": {
        "percentile_score": 1
      },
      "peak_score": 1,
      "confidence_score": 1,
      "discovered_at": "2026-09-05T06:49:26.587Z",
      "earliest_evidence_at": "2026-09-05T06:49:26.587Z",
      "last_signal_at": "2026-09-05T06:49:26.587Z",
      "updated_at": "2026-09-05T06:49:26.587Z",
      "source_summary": {
        "additionalProperty": 1
      },
      "citations": [
        {
          "source_category": "string",
          "source_url": "string",
          "title": "string",
          "display": "",
          "snippet": "string",
          "source_authority": 1,
          "engagement_score": 1,
          "published_at": "2026-09-05T06:49:26.587Z"
        }
      ],
      "entities": [
        {
          "canonical_name": "string",
          "entity_id": "string",
          "entity_type": "string",
          "confidence": 1,
          "entity_subtype": "string"
        }
      ],
      "trend": {
        "momentum": 0,
        "direction": "up"
      },
      "citation_rate": [
        {
          "day": "string",
          "count": 1
        }
      ],
      "narrative": {
        "narrative_id": "string",
        "display_name": "string",
        "member_count": 1,
        "arc_summary": [
          "string"
        ]
      },
      "temporal_status": "upcoming",
      "event_start_at": "2026-09-05T06:49:26.587Z",
      "event_end_at": "2026-09-05T06:49:26.587Z"
    }
  ],
  "stories": [
    {
      "requested_view": "cluster",
      "seed_topic": {
        "topic_id": "string",
        "topic_name": "string",
        "vertical": "string",
        "category": "string",
        "status": "string",
        "score": 1,
        "relevance_score": 1,
        "engagement": {
          "percentile_score": 1
        },
        "peak_score": 1,
        "confidence_score": 1,
        "discovered_at": "2026-09-05T06:49:26.587Z",
        "earliest_evidence_at": "2026-09-05T06:49:26.587Z",
        "last_signal_at": "2026-09-05T06:49:26.587Z",
        "updated_at": "2026-09-05T06:49:26.587Z",
        "source_summary": {
          "additionalProperty": 1
        },
        "citations": [
          {
            "source_category": "string",
            "source_url": "string",
            "title": "string",
            "display": "",
            "snippet": "string",
            "source_authority": 1,
            "engagement_score": 1,
            "published_at": "2026-09-05T06:49:26.587Z"
          }
        ],
        "entities": [
          {
            "canonical_name": "string",
            "entity_id": "string",
            "entity_type": "string",
            "confidence": 1,
            "entity_subtype": "string"
          }
        ],
        "trend": {
          "momentum": 0,
          "direction": "up"
        },
        "citation_rate": [
          {
            "day": "string",
            "count": 1
          }
        ],
        "narrative": {
          "narrative_id": "string",
          "display_name": "string",
          "member_count": 1,
          "arc_summary": [
            "string"
          ]
        },
        "temporal_status": "upcoming",
        "event_start_at": "2026-09-05T06:49:26.587Z",
        "event_end_at": "2026-09-05T06:49:26.587Z"
      },
      "surface": {
        "story_id": "string",
        "surface_type": "topic",
        "member_topic_ids": [
          "string"
        ],
        "lead_topic_id": "string",
        "display_name": "string",
        "description": "string",
        "story_score": 1,
        "latest_signal_at": "2026-09-05T06:49:26.587Z",
        "member_count": 1,
        "coherence_score": 1,
        "projection_refreshed_at": "2026-09-05T06:49:26.587Z"
      },
      "member_topics": [
        {
          "topic_id": "string",
          "topic_name": "string",
          "vertical": "string",
          "category": "string",
          "status": "string",
          "score": 1,
          "relevance_score": 1,
          "engagement": {
            "percentile_score": 1
          },
          "peak_score": 1,
          "confidence_score": 1,
          "discovered_at": "2026-09-05T06:49:26.587Z",
          "earliest_evidence_at": "2026-09-05T06:49:26.587Z",
          "last_signal_at": "2026-09-05T06:49:26.587Z",
          "updated_at": "2026-09-05T06:49:26.587Z",
          "source_summary": {
            "additionalProperty": 1
          },
          "citations": [
            {
              "source_category": "string",
              "source_url": "string",
              "title": "string",
              "display": "",
              "snippet": "string",
              "source_authority": 1,
              "engagement_score": 1,
              "published_at": "2026-09-05T06:49:26.587Z"
            }
          ],
          "entities": [
            {
              "canonical_name": "string",
              "entity_id": "string",
              "entity_type": "string",
              "confidence": 1,
              "entity_subtype": "string"
            }
          ],
          "trend": {
            "momentum": 0,
            "direction": "up"
          },
          "citation_rate": [
            {
              "day": "string",
              "count": 1
            }
          ],
          "narrative": {
            "narrative_id": "string",
            "display_name": "string",
            "member_count": 1,
            "arc_summary": [
              "string"
            ]
          },
          "temporal_status": "upcoming",
          "event_start_at": "2026-09-05T06:49:26.587Z",
          "event_end_at": "2026-09-05T06:49:26.587Z"
        }
      ],
      "search_match": {
        "matched_topic_ids": [
          "string"
        ],
        "matched_topic_count": 1,
        "match_sources": [
          "string"
        ]
      }
    }
  ],
  "search_mode": "string"
}