Google Sheets

=DRAZILL() and =DRAZILLHIST() — live market prices in a spreadsheet, over the public API, with your own key.

Two custom functions put Drazill market data in any Google Sheet. They call the same public endpoints documented in this reference — no private surface, no shared credential, no server in the middle.

=DRAZILL("boc-rate-cut-september") → 0.62
=DRAZILL("boc-rate-cut-september", "title") → Will the Bank of Canada cut rates in September?
=DRAZILLHIST("boc-rate-cut-september", 30) → 30 days of daily closes, one column per outcome

The add-on is read-only. It cannot place an order, move money, or read your balance — and it requests no Google permission that would let it write to your spreadsheet.

The formulas

=DRAZILL(market, [field], [outcome])

ArgumentAccepts
marketA market slug, a market id, a pasted market URL — or a range of them.
fieldprice (default), title, volume, closes_at, status.
outcomeFor price: the outcome to price, e.g. "No". Defaults to the market’s first outcome.
=DRAZILL("boc-rate-cut-september") the first outcome's price
=DRAZILL("boc-rate-cut-september", "price", "No") a named outcome
=DRAZILL("boc-rate-cut-september", "closes_at") the close time, as a date
=DRAZILL(A2:A50) a whole column, in one batch

Passing a range is not just shorthand: every market in it is fetched in a single batched request, and a market repeated inside the range is fetched once. A column of fifty markets costs one round trip, not fifty.

=DRAZILLHIST(market, [days])

Spills a header row (Date, then one column per outcome) followed by one row per day of daily closing prices. days defaults to 30.

A day an outcome has no recorded point is left blank — never zero-filled and never carried forward from the previous day, so a gap in the data reads as a gap.

Your key, and only yours

You supply your own API key. It is stored per Google account, in the add-on’s per-user property store — not in a cell, not in a shared script store, and not on any Drazill server beyond the key you already minted.

Sharing a sheet shares the values your formulas produced, because those values live in the cells. It never shares your key. For a collaborator to refresh those cells, they set their own key in the same sidebar.

A key is required rather than optional. Anonymous reads are limited per IP (Rate limits), and Google Apps Script calls out from shared egress ranges — so an unkeyed add-on would share one anonymous bucket with every other Apps Script user calling Drazill. With your key, you get your own per-key limit and quota.

Requests carry three headers and nothing else: X-API-Key, Accept, and a static User-Agent. No document id, user id, or email address is sent.

Environments

EnvironmentBase URLKeys
Staging (the default)https://staging.drazill.comdrzl_test_
Productionhttps://api.drazill.comdrzl_live_

The add-on ships pointed at staging; production is a choice you make in the sidebar. Both hosts are pinned in the Apps Script manifest, so the add-on cannot fetch anywhere else. Start at Get an API key.

When a cell cannot be fetched

Cells show a #DRAZILL: … message that names the real condition. They never show a stale number, a zero, or a guess.

CellMeans
#DRAZILL: no API key — Extensions ▸ Drazill ▸ Set API keyNo key saved for your account yet.
#DRAZILL: unknown marketNo market with that slug or id.
#DRAZILL: rate limited — retry in 30sA 429; the wait comes from the Retry-After header.
#DRAZILL: key rejected — Extensions ▸ Drazill ▸ Set API keyA 401.
#DRAZILL: key not allowed to read markets — check its scopesA 403.
#DRAZILL: Drazill returned 503 — no dataAn upstream failure, with the real status.
#DRAZILL: no outcome named "Maybe"Argument 3 matched no outcome — it never silently prices the other side.

What it calls

Everything above runs on endpoints that already exist. The add-on adds nothing to the API:

EndpointUsed for
GET /api/v1/markets/slug/{slug}=DRAZILL with a slug
GET /api/v1/markets/{market_id}=DRAZILL with a market id
GET /api/v1/markets/{market_id}/price-history=DRAZILLHIST
GET /api/v1/usagethe sidebar’s Test key button

Installing it today

The add-on is not published to the Google Workspace Marketplace. That listing is a deliberate, separate decision, and it has not been made — so there is no one-click install link, and this page does not pretend otherwise.

What works today is deploying your own copy. The Apps Script project lives at integrations/sheets, and its README covers the clasp steps end to end:

npm i -g @google/clasp && clasp login
clasp create --type sheets --title "Drazill" --rootDir ./src
clasp push

Then open the sheet and set your key under Extensions ▸ Drazill ▸ Set API key….