Skip to main content
Semantic search across wiki knowledge items. Uses hybrid ranking (vector cosine similarity + tsvector lexical matching, RRF fusion) to return the most relevant results.
  • Cost: 1 credit per call
  • Query limit: 2,000 characters max

Endpoint

POST https://api.llmquantdata.com/api/wiki/search

Authentication

Include a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY

Request Body

query
string
required
Search query string (e.g. momentum factor, Black-Scholes, pairs trading). Max 2,000 characters.
topK
number
Maximum number of results to return.

Response

The response follows the standard {data, meta} envelope.
data
array
Array of wiki items ranked by relevance.
meta
object

Code Examples

import requests

url = "https://api.llmquantdata.com/api/wiki/search"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
}

response = requests.post(url, headers=headers, json={
    "query": "momentum factor",
    "topK": 5,
})

result = response.json()
for item in result["data"]:
    print(item["title"], "-", item["summary"])

print(f"Credits remaining: {result['meta']['remainingCredits']}")

Wiki Read

Read the full content of a single wiki item by ID. Use this after search to retrieve the complete article.
  • Cost: Free (0 credits)

Endpoint

GET https://api.llmquantdata.com/api/wiki/items/{id}

Authentication

Include a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY

Path Parameters

id
string
required
The knowledge_item_id of the wiki item to read.

Query Parameters

max_length
number
Maximum character length for the body_markdown field. Use this to preview content before deciding to read the full article.

Response

data
object
meta
object

Code Examples

import requests

item_id = "abc123"
url = f"https://api.llmquantdata.com/api/wiki/items/{item_id}"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

# Preview first 500 characters
response = requests.get(url, headers=headers, params={"max_length": 500})
item = response.json()["data"]
print(item["title"])
print(item["body_markdown"])

# Read full article (omit max_length)
response = requests.get(url, headers=headers)
item = response.json()["data"]
print(item["body_markdown"])