Madjik API documentation

Using the Madjik API for AI

Feed live market metrics to AI applications.

Why it fits AI consumption

  • Structured JSON with explicit signal and confidence per metric
  • Normalized values (value_normalized, 0–100) in time series for easy interpretation
  • Per-point provenance labels so a model can weigh live data above backfills and forecasts
  • Freshness flags on every payload — your AI knows when data is stale

Example: market context for an LLM

import requests

BASE = "https://api.madjik.io/v1"
headers = {"X-API-Key": "YOUR_API_KEY"}

def get_market_context(metric_ids):
    r = requests.get(f"{BASE}/metrics",
                     params={"metric_ids": ",".join(metric_ids)},
                     headers=headers)
    r.raise_for_status()
    return r.json()["data"]

# sentiment, funding, liquidation-related metrics from your catalog
context = get_market_context(["M50030", "M50014", "M50016"])
prompt = f"Given this market data: {context}, summarize current conditions."
# feed `prompt` to the LLM of your choice

Pick metric ids from your accessible catalog (GET /v1/catalog) — ids are sequential and carry no meaning, so do not hard-code assumptions about what an id range contains.

Best practices

  • Cache responses — respect each metric's cadence (listed on its catalog page)
  • Batch with metric_ids= instead of one call per metric
  • Include metric descriptions in prompts — classic metric descriptions are on each metric's docs page
  • Degrade gracefully — your AI should work with partial data when a metric is stale

See also: MCP integration (ready-made tool endpoints) · A2A integration.