Start here
A key, a first search, a first alert and a first analysis — in ten minutes.
This is the shortest path from an empty account to a working integration. Each step
links to the page that explains it in full.
1. Create an API key
Open your account and create a key. The plaintext is shown
once; the server stores a hash. Send it on every request:
export DEJABARS_KEY="tc_live_…"
export API="https://dejabars.com/api/v1/app"
curl -s -H "X-API-Key: $DEJABARS_KEY" "$API/search/algorithms" | head
If the call returns 401, the key is wrong or revoked. Keys belong to the account that
created them, so every call is charged to that account.
2. Run a search
A search takes a list of Y values in the 0–1 range (the sketch) and the same list of X
positions. This example asks for a shape across the last 30 days on the 1h timeframe.
curl -s -X POST "$API/search-task" \
-H "X-API-Key: $DEJABARS_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: first-scan-001' \
-d '{
"pattern": [0.42, 0.51, 0.47, 0.63, 0.58],
"xs": [0.0, 0.2, 0.4, 0.6, 0.8],
"timeframe": "1h",
"period_days": 30,
"search_mode": "geo",
"max_distance": 0.35
}'
The response carries a task_id. Poll it:
curl -s -H "X-API-Key: $DEJABARS_KEY" "$API/task-status/<task_id>"
# {"status":"running","progress":"42"}
When the status is completed, read the result:
curl -s -H "X-API-Key: $DEJABARS_KEY" "$API/task-result/<task_id>"
The next page, Run a search, explains pricing, timeframes and the matcher
flags. Read the results explains the payload.
3. Receive an alert
A watch re-runs a pattern on every closed candle and delivers a webhook when it matches.
Create the destination once; keep the signing secret:
curl -s -X POST "$API/notifications/destinations" \
-H "X-API-Key: $DEJABARS_KEY" \
-H 'Content-Type: application/json' \
-d '{"channel":"webhook","target":"https://example.com/hooks/dejabars","label":"prod"}'
The response contains a secret. Store it. Every delivery is signed with it.
Then create the watch:
curl -s -X POST "$API/watches" \
-H "X-API-Key: $DEJABARS_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "Ascending triangle",
"pattern": [0.42, 0.51, 0.47, 0.63, 0.58],
"xs": [0.0, 0.2, 0.4, 0.6, 0.8],
"coins": "all",
"lanes": [{"timeframe":"1h","engines":["geo"],"tolerance":0.35}]
}'
Send a test delivery with POST /notifications/destinations/{id}/test before you rely on
it. Set up alerts and Receive webhooks go deeper.
4. Analyse a report
Outcome Lab asks a question about a finished search report. Start from the question
library, because it returns a complete spec:
curl -s -H "X-API-Key: $DEJABARS_KEY" "$API/analytics/questions" | head -c 800
Take one question's spec, quote it, then run it:
curl -s -X POST "$API/analytics/offer" \
-H "X-API-Key: $DEJABARS_KEY" -H 'Content-Type: application/json' \
-d '{"spec": <spec from the question>}'
The quote returns an offer_id and a token cost. Pass both to POST /analytics.
Run an analysis covers the full flow.
5. Check what you spent
Open API usage from the account menu. It lists
every API and MCP call with its status, token cost and latency. It stays empty until the
first call from a key or an agent session.
Where to go next
- Run a search — pricing, timeframes, matcher flags.
- Set up alerts — watches, coins, lanes, pause/resume.
- Receive webhooks — payload, signature, retries, test.
- Run an analysis — questions, quote, run, export.
- Tokens, cost and limits — free windows and the 402.
- Errors and retries — what is safe to retry.
- MCP for agents — one endpoint for an AI host.
Open the interactive reference and run the operation with your key.
