Docs
Recipes
Four loops that each end in two calls. Nobody asks for precedent every day. They ask before something happens, or when a number moves.
Before a scheduled release
The calendar is open and needs no key. Ask what is next, then ask what followed every past one of that kind. An agent can run the first call on a timer and only reach for the second when something is close.
curl 'https://priorcase.com/v1/events/upcoming?limit=1&days=30'{"events": [{
"slug": "claims-due-2026-11-05",
"kind": "claims",
"name": "Jobless claims",
"known_at": "2026-11-05T13:30:00Z",
"source": "https://www.dol.gov/ui/data.pdf; FRED release 180 calendar",
"topics": ["claims"]
}]}Take a slug from topics and ask for the record. alike=now ranks the same list by how much each past moment resembled this one, so the ones worth reading come first.
curl -H "Authorization: Bearer $PRIORCASE_KEY" \
'https://priorcase.com/v1/after/cpi?asset=BTC&alike=now'109 CPI releases come back, each with what was knowable at that moment and the path that followed it. Ranked against now, the top three on 3 November 2026 were:
2018-03-13 12:30 CPI release for February 2018: +0.2% likeness 0.574 next 24h -3.63%
2026-09-11 12:30 CPI release for August 2026: +0.4% likeness 0.528 next 24h +0.33%
2020-07-14 12:30 CPI release for June 2020: +0.6% likeness 0.519 next 24h +0.14%Over MCP the same loop is list_events(upcoming=true, limit=1) then get_topic_outcomes(topic="cpi", alike="now").
When the screen moves
Ask for the moments that look like this one, then draw their paths on one axis. The second call takes the timestamps the first returned, so the two are one thought.
curl 'https://priorcase.com/v1/search?asset=BTC' # no key
curl -H "Authorization: Bearer $PRIORCASE_KEY" \
'https://priorcase.com/v1/paths?asset=BTC&at=2018-05-11T11:00:00Z&at=2025-11-03T17:00:00Z'Read quality before reading the set. It says how many moments were alike enough to be candidates and how widely their outcomes spread, which is the difference between eight precedents and eight coincidences. Reading the screen names each field.
Over MCP: find_analogs() then get_price_paths(at=[…]).
When a condition becomes true
A condition is one fact the bars can answer, written in words. The response carries how it was understood, so an agent can check the reading before trusting the moments.
curl -H "Authorization: Bearer $PRIORCASE_KEY" \
'https://priorcase.com/v1/when?asset=BTC&q=fell%2010%25%20in%20a%20day&limit=8'The phrasings it reads are the price level, a move over an hour, a day or three days, how far below the 7-day high, and how loud the day was against its month. /v1/assets returns the list beside the assets, with no key.
Over MCP: query_history(q="fell 10% in a day").
Before you trust a backtest
Every moment is point-in-time: it reports what had closed or been published by then, and what came after is labelled as having come after. That is what makes the call below a fair question rather than a leak.
curl -H "Authorization: Bearer $PRIORCASE_KEY" \
'https://priorcase.com/v1/moment/2021-09-24T20:00:00Z?asset=BTC'Ask about a past moment and you get the same shape you would have got standing there. A past moment becomes eligible as an answer only once its following 32 hours have closed, so nothing is scored on a window that is still open.
Over MCP: get_market_state(at="2021-09-24T20:00:00Z").
Limits and errors: what a call costs and what each refusal means →