GET
/
api
/
search
/
query
curl --request GET \
  --url https://api.data.adj.news/api/search/query \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "market_id": "<string>",
      "platform_id": "<string>",
      "ticker": "<string>",
      "adj_ticker": "<string>",
      "market_slug": "<string>",
      "platform": "<string>",
      "market_type": "<string>",
      "question": "<string>",
      "description": "<string>",
      "rules": "<string>",
      "result": "<string>",
      "link": "<string>",
      "status": "<string>",
      "reported_date": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>",
      "end_date": "<string>",
      "resolution_date": "<string>",
      "probability": 123,
      "volume": 123,
      "open_interest": 123,
      "liquidity": 123,
      "category": "<string>",
      "tags": [
        "<string>"
      ],
      "platform_ids": {},
      "status_details": {},
      "settlement_sources": [
        "<string>"
      ],
      "comments_count": 123,
      "has_comments": 123,
      "trades_count": 123,
      "event": "<string>"
    }
  ],
  "meta": {
    "query": "<string>",
    "score": 123
  }
}

This endpoint provides powerful semantic search capabilities that go beyond simple keyword matching. It uses machine learning-based vector embeddings to find markets that are conceptually related to your search query, even if they don’t contain the exact words.

How It Works

The search uses Cloudflare Vectorize to find markets semantically related to your query:

  1. Your search query is converted to a vector embedding
  2. This embedding is compared to pre-computed embeddings of all markets
  3. Markets with the most similar embeddings are returned
  4. If vector search fails, it falls back to a sophisticated text search algorithm

Query Parameters

  • q (required): The search query text
  • limit (optional): Maximum number of results to return (default: 10)
  • include_context (optional): Whether to include relevance scores and match context (default: false)

Response Format

{
  "data": [
    {
      "market_id": "polymarket_will-us-inflation-exceed-3-percent-in-2025",
      "platform": "polymarket",
      "question": "Will US inflation exceed 3% in 2025?",
      // ... other market fields
    },
    // ... more markets
  ],
  "meta": {
    "query": "future inflation rates",
    "score": 0.95  // Only included if include_context=true
  }
}

Search Capabilities

This endpoint can handle various types of search queries:

  • Conceptual Searches: “economic impact of election”
  • Question-Based Searches: “Will Trump win in 2024?”
  • Topic Searches: “climate change predictions”
  • Event Searches: “world cup outcomes”

Text Search Fallback

If vector search is unavailable or returns insufficient results, the search will automatically fall back to text search, which:

  1. Breaks your query into keywords
  2. Searches for these keywords across questions, descriptions, and rules
  3. Ranks results by relevance and recency

Use Cases

  1. Natural Language Search: Allow users to search using everyday language
  2. Discovery Interfaces: Help users find markets related to concepts they’re interested in
  3. Research Tools: Find markets related to specific topics for analysis
  4. Recommendation Systems: Suggest markets based on user interests

Example Queries

# Search for markets about presidential elections
curl "https://api.data.adj.news/api/search/query?q=who%20will%20win%20the%20presidential%20election"

# Search with context information included
curl "https://api.data.adj.news/api/search/query?q=climate%20change%20impact&include_context=true"

Authorizations

Authorization
string
header
required

Enter your API key as the bearer token

Query Parameters

q
string
required

Search query text

limit
integer
default:10

Number of results to return

include_context
boolean
default:false

Include context and relevance info

Response

200 - application/json
Search results
data
object[]
meta
object