Semantic Search
Search for markets using natural language and semantic understanding
Advanced AI-Powered Market Search
This endpoint provides state-of-the-art semantic search capabilities that revolutionize how you discover and explore prediction markets. Unlike traditional keyword-based search, our AI-powered system understands the meaning and context of your queries to deliver highly relevant results, even when markets use different terminology than your search terms.
How Semantic Search Works
🧠 The Technology Behind It
Our semantic search system leverages advanced machine learning to understand the true meaning of your queries:
- Vector Embeddings: Your search query is converted into a high-dimensional vector that captures its semantic meaning
- Cloudflare Vectorize: We use Cloudflare’s powerful vector database to store and search through embeddings of all markets
- Similarity Matching: The system finds markets with embeddings most similar to your query vector
- Intelligent Ranking: Results are ranked by semantic similarity, recency, and market activity
- Fallback Protection: If vector search fails, automatic fallback to sophisticated text search ensures you always get results
🎯 Why Semantic Search Matters
Traditional search would miss many relevant markets. Our semantic search finds connections that keyword search cannot:
Example Queries and Matches:
- “Economic downturn” → Markets about “recession,” “GDP decline,” “unemployment rise”
- “Space exploration” → Markets about “Mars missions,” “SpaceX launches,” “NASA programs”
- “Tech regulation” → Markets about “antitrust,” “data privacy laws,” “social media oversight”
- “Climate action” → Markets about “carbon tax,” “renewable energy,” “Paris agreement”
API Reference
Query Parameters
Your search query in natural language.
Examples:
"Will Trump win in 2024?"
"future of artificial intelligence"
"climate change impacts"
"economic indicators recession"
Tips:
- Use natural language - ask questions as you would to a person
- Include specific entities (names, places, organizations)
- Context matters - “Apple stock” vs “Apple fruit”
Maximum number of markets to return.
- Range: 1-100 markets
- Default: 10 markets
- Performance: Larger limits may increase response time
- Tip: Start with 10-20 for most use cases
Include additional context and relevance information.
When enabled, provides:
- Relevance scores (0.0-1.0)
- Search method used (vector/fallback)
- Query processing details
- Performance metrics
Filter results to specific platforms.
Supported platforms:
kalshi
- Kalshi marketspolymarket
- Polymarketmanifold
- Manifold Marketsmetaculus
- Metaculus
Format: "kalshi,polymarket"
for multiple platforms
Filter by market category.
Common categories:
politics
- Political events and electionseconomics
- Economic indicators and marketstechnology
- Tech developments and trendssports
- Sports outcomes and eventsentertainment
- Media and celebrity events
Response Format
Standard Response
Enhanced Response (with context)
Search Capabilities & Examples
1. Conceptual Searches
Find markets related to broad concepts:
2. Question-Based Searches
Search using natural questions:
3. Topic-Based Discovery
Explore markets around specific topics:
4. Entity-Focused Searches
Find markets related to specific people, companies, or organizations:
Advanced Search Techniques
Filtering and Refinement
Multi-dimensional Queries
Fallback Text Search
When Fallback Activates
If vector search is unavailable or returns insufficient results, the system automatically uses advanced text search:
Fallback triggers:
- Vector search service temporarily unavailable
- Query returns fewer than 3 results
- Very new markets not yet indexed for vector search
How Text Search Works
- Query Processing: Breaks down your query into meaningful keywords
- Fuzzy Matching: Handles typos and variations in spelling
- Relevance Ranking: Scores results based on keyword frequency, recency, and market activity
- Context Awareness: Considers market descriptions, rules, and tags
Fallback Response
Use Cases & Applications
1. Market Discovery Platforms
Build intuitive search interfaces for market exploration:
2. Research & Analysis Tools
Power analytical applications with semantic search:
3. Personalized Recommendations
Create recommendation systems based on user interests:
4. Content Curation
Curate markets for newsletters, dashboards, or feeds:
Performance & Optimization
Response Time Optimization
Typical Performance:
- Vector Search: 0.1-0.5 seconds
- Text Fallback: 0.2-0.8 seconds
- Factors: Query complexity, result count, filtering
Optimization Tips:
- Use smaller
limit
values for faster responses - Cache frequently searched terms
- Implement request debouncing for auto-suggest
- Consider pagination for large result sets
Caching Strategy
Search Quality Tips
-
Query Construction:
- Be specific but not overly restrictive
- Include context for ambiguous terms
- Use natural language over keyword stuffing
-
Result Processing:
- Consider relevance scores when available
- Implement result deduplication if needed
- Combine with other filtering for precision
Error Handling & Troubleshooting
Common Issues
No Results Found
Solutions:
- Broaden your search terms
- Remove platform or category filters
- Try related concepts or synonyms
- Check for typos in your query
Poor Result Quality
Symptoms: Irrelevant or low-quality matches Solutions:
- Be more specific in your query
- Use
include_context=true
to understand matching - Add context words to clarify meaning
- Consider using entity names or specific terminology
Slow Response Times
Causes: Complex queries, large result sets, system load Solutions:
- Reduce the
limit
parameter - Simplify your query
- Implement caching
- Use pagination for large result sets
Error Responses
Best Practices
Search Query Design
- Natural Language: Write queries as you would ask a person
- Specificity Balance: Specific enough to be relevant, broad enough to find results
- Context Inclusion: Add context for ambiguous terms
- Entity Names: Include specific names of people, places, organizations
Integration Patterns
- Auto-suggest: Implement debounced search with small limits
- Pagination: Use limit/offset for large result sets
- Caching: Cache popular searches to improve performance
- Fallback Handling: Always handle both vector and text search responses
User Experience
- Loading States: Show search progress for longer queries
- Result Highlighting: Highlight matching terms in results
- Search Suggestions: Offer query refinement suggestions
- Error Recovery: Provide helpful error messages and suggestions
Questions or Issues? Contact our team at lucas@adj.news with:
- Example queries that aren’t working as expected
- Performance concerns or optimization questions
- Integration support needs
Authorizations
Enter your API key as the bearer token
Query Parameters
Search query text
Number of results to return, default is 5 results
Include context and relevance info
Response
Search results
The response is of type object
.