Which to use: it depends on whether your page already draws a chart.
| Your product | What to use |
|---|---|
| A stock or multi-asset platform with its own chart and bars | Our marks on your chart: TradingView Advanced Charts or Lightweight Charts. Stocks with exchange sessions are drawn (NVDA, GOOGL). |
| A crypto venue or a Hyperliquid front end | The same two adapters, for symbols traded around the clock (BTC, ETH). |
| A page with no chart of its own | The ready chart: Hyperliquid candles for about 140 tickers, about a hundred stocks among them (NVDA, GOOGL, NBIS), and daily Binance candles for other tokens. A stock without a Hyperliquid contract has no ready chart: draw your own chart and put our marks on it. |
On both adapters, a call published while no bar stood (a night or a weekend on a stock chart) is counted on the next bar, and a call after the newest bar on that bar until a newer one comes, each as far as a week. On a Sunday a daily stock chart shows the weekend's calls on Friday's candle, and on Monday's once that candle is there; a click lists the same calls.
The ready chart
Paste this iframe into your page and replace the widget ID with yours. Your widget ID must list your site. You need no key or backend.
<iframe src="https://buzzberg.ai/embed/v1/chart?w=wgt_0123456789abcdef&ticker=BTC&theme=dark&interval=1d"
title="Buzzberg chart with calls on BTC" width="100%" height="860" style="border:0" loading="lazy"
referrerpolicy="strict-origin-when-cross-origin"></iframe>| Parameters | w (widget ID), ticker, theme (auto, light, dark), interval (1h, 4h, 1d; 1d by default). |
| Where it shows | Only in a frame on one of the widget's sites. The request's Referer must be a page of an allowed site, so keep referrerpolicy="strict-origin-when-cross-origin" on the iframe. Opened in a tab, it shows "This chart is shown only inside its partner's site". |
| Candles | Instruments traded on Hyperliquid: about 140 listed contracts (BTC, ETH and other major tokens, about a hundred stocks such as NVDA, GOOGL and NBIS, and funds, commodities and indexes) and the tokens of its main perpetual book. 1h covers 14 days, 4h 30 days, 1d 365 days. Other crypto: daily candles only, when Buzzberg holds at least two stored Binance daily candles and the newest is at most 7 days old; a token also falls back to them when Hyperliquid has none. Other tokens, and stocks and funds without a Hyperliquid contract: no chart (a card says so); for such a stock, put our marks on your own chart. |
| Limits | 60 requests a minute per IP address. A 200 response is private, max-age=60. |
The ready chart, live on BTC.
Height, use and cards
| Height | The page fills the frame it is given. The chart is 380 px tall (320 on screens narrower than 640 px) and shrinks to 240 in a short frame. The picked candle's calls take the rest, at least 320 px (260 on narrow screens), and a longer list scrolls inside its card; with no candle open, the chart keeps its full height. An 860 px frame shows the chart at full height; 760 px still fits without scrolling the frame. The page posts {type: 'buzzberg-widget:height', height} to its host: the frame's own height or, in a shorter frame, the minimum height the layout needs. The loader buzzberg-widget-v1.js creates this frame for an element with data-kind="chart" (Widget builder). |
| State | The page tells its host ready, unknown_ticker, no_chart (tracked, but no price chart, and a retry will not change that: hide the chart; a calls widget can show its calls), unavailable or refused. With the loader, the element gets data-buzzberg-state and a buzzberg-widget:state event (State). |
| Use | Drag to move the chart; pinch or drag the time axis to zoom. The mouse wheel scrolls your page. A line above the chart shows the candle under the pointer: time, open, high, low, close, change, and the counts of its long calls and of its short and avoid calls. Below 480 px wide it leaves out open, high and low. Prices are grouped by thousands. Click a candle with arrows to list its calls under the chart; the newest such candle is open on load. |
| Card | Status | When |
|---|---|---|
| This widget is unavailable. | 404 | Unknown widget ID. |
| This chart is shown only inside its partner's site. | 403 | No Referer of an allowed site. |
| Buzzberg has no calls for … | 404 | A symbol Buzzberg does not track. |
| Buzzberg has no price chart for … | 200 | No candles for this ticker. |
| The chart is unavailable right now. | 503 429 | A failed read, or the request limit. |
Your own Lightweight Charts chart
For a page that already draws a Lightweight Charts chart. Supports Lightweight Charts 4.1 and later, including version 5. For earlier 4.x versions, supply candles. The script puts the arrows on your candles.
<script src="https://buzzberg.ai/static/js/buzzberg-chart-v1.js"></script>
<script>
const calls = BuzzbergChart.connect({
widgetId: 'wgt_0123456789abcdef',
ticker: 'BTC',
chart, series, // your chart and its price series
details: document.getElementById('calls'), // optional: where a picked candle's calls open
theme: 'dark',
});
</script>- Long calls get an arrow under the bar; short and avoid calls get one over it. The arrows are the library's series markers. When an arrow stands for more than one call and there is room, its count is written beside it.
- Clicking such a bar opens its calls in
details, in the calls widget's card: up to 30 calls, newest first. Clicking an arrow lists that side only; clicking or tapping the candle lists both. Withoutdetails, a click only callsonSelect. - The script notices new candles itself, at most once every 250 ms. It does not poll: counts older than a minute are read again when the bars change or you call
update. - On Lightweight Charts 4, a series has a single list of markers. The script keeps your markers in it; after you set markers yourself, call
redraw(). On version 5 the two lists are separate.
The candle card's iframe also posts state messages to your page; the adapter ignores them, and its own onState and state() report what the arrows show.
Bars and calls
| Bar length | A day or longer: matched by UTC date. One hour up to a day: by whole UTC hours (a bar that opens at 13:30 counts from 13:00). Shorter than an hour: not served, state unsupported_interval. |
| Bar times | UTC, as the library expects. A page that shifts every bar to local time passes the shift as timeOffset. |
| Gaps | A bar covers the time up to the next bar. A call in a gap before a bar (a night or a weekend) is counted on that bar, as far as a week before it ends; a call after the newest bar is counted on it until a newer bar comes, as far as a week. A bar longer than a week counts its whole stretch, and its card lists the last week. Calls before the first bar are not drawn. |
| History | Counts: 365 days by day, 30 days by hour. Calls of a candle: the last 30 days; an older candle opens a card that says its calls are not listed. |
| Which calls | The calls the partner feed serves for the exact instrument. An arrow and its list can differ by a few calls: counts are usually up to a minute old (11 minutes at most, the page's own one-minute copy included), a call saved late reaches the arrows within about 40 minutes, and a call the feed cannot show is counted but not listed. |
Options of connect
| Option | Meaning |
|---|---|
widgetId | Your widget ID, or sample to try it on any page: frozen counts and cards of the sample tickers, drawn on your own candles of the same days. |
ticker | Any symbol Buzzberg tracks. |
chart, series | Your chart and its price series. One adapter per series: a second connect replaces the first. |
details | Optional element where a picked candle's calls open. |
theme | auto, light or dark. |
colors | {bullish, bearish}; #22a05a and #e0524d by default. |
size | Marker size, 0.8 by default. |
detailsHeight, detailsMaxHeight | Height of the calls card, 420 and 4000 pixels by default; the card reports its own height. |
barSeconds | The bar length when it cannot be read from the data, as with a single bar. |
timeOffset | Seconds the page added to every bar time to show local time. |
candles | An array or a function, when the series has no data() (before 4.1). |
createSeriesMarkers, library | Lightweight Charts 5 loaded as an ES module. The standalone build is found on window.LightweightCharts. |
onState(state) | Called with {state, ticker, interval, calls, as_of, error, detail}; first inside connect. |
onSelect(candle) | Called with {time, from, to, side, bullish, bearish, listed, url}: side is bullish, bearish or null; listed is false for a candle older than the listed calls. |
The returned object
| Call | Meaning |
|---|---|
update({ticker, theme, barSeconds, timeOffset, candles}) | Updates the instrument or settings and returns a promise resolving to the adapter state. |
refresh() | Reads the counts again. Returns a promise of the state. |
redraw() | Draws the arrows again. |
select(time, side) | Opens a bar by its time, as a click does. |
close() | Removes the calls card. |
state() | The last state. |
counts(time) | The counts drawn on the bar with that time, {bullish, bearish}, or null when there is no such bar. |
destroy() | Ends the adapter; called before the chart is removed. |
States
| State | When |
|---|---|
loading | The counts are being read. |
ready | Arrows drawn. After a failed re-read the arrows already drawn stay, with error set. |
empty | No bars yet, or no calls on them. |
unsupported_interval | Bars shorter than an hour. |
error | error is unknown_widget, origin_not_allowed, unknown_ticker, too_many_requests, unavailable, network or markers_unavailable. The adapter keeps an error state for a minute before it asks again. |
Addresses
| Address | Response and who may read it |
|---|---|
GET /embed/v1/chart-data?w=&ticker=&interval=1d|1h | JSON: buckets as [start, long calls, short and avoid calls], empty buckets left out, with ticker, name, version, interval, bucket_seconds, from, to, as_of and window. Read by a script on an allowed site: the request's Origin must be one of the widget's sites. |
GET /embed/v1/chart?w=&ticker=&theme=&interval= | The ready chart (HTML), framed only by the allowed sites. |
GET /embed/v1/chart-calls?w=&ticker=&from=&to=[&side=][&theme=] | The calls card (HTML), framed only by the allowed sites. from and to are whole hours in UTC seconds, at most 7 days apart, starting no more than 30 days back (31 for a daily candle that began a day earlier). |
- Both responses are
private, max-age=60. Each IP address can read the counts 120 times a minute, and the card 60 times a minute and 1,000 times a day. - Requests go to the origin serving
buzzberg-chart-v1.js, normallyhttps://buzzberg.ai. - Allow
https://buzzberg.aiinscript-srcandconnect-src, and inframe-srcwhen using the calls card.
TradingView Advanced Charts
Built and tested against TradingView's published datafeed and marks interfaces, not against the Charting Library itself, which TradingView distributes on request.
For a chart drawn with TradingView's Charting Library. The same script adds our marks through your datafeed.
<script src="https://buzzberg.ai/static/js/buzzberg-chart-v1.js"></script>
<script>
const calls = BuzzbergChart.connectAdvanced({
widgetId: 'wgt_0123456789abcdef',
datafeed: yourDatafeed, // the datafeed you already give the library
ticker: (symbolInfo) => 'BTC', // your symbol -> the Buzzberg ticker, or null
details: document.getElementById('calls'), // optional: where a picked bar's calls open
theme: 'dark',
});
const widget = new TradingView.widget({ ...yourOptions, datafeed: calls.datafeed });
widget.onChartReady(() => calls.bind(widget));
</script>- Pass
calls.datafeedto the library. It is your datafeed, except thatonReadyalso reportssupports_marks: trueandgetMarksreturns your marks plus ours. The combined marks response waits at most four seconds for each source. Every other method is yours, unchanged;getBarsandsubscribeBarspass through to it. - Each bar gets one mark for long calls and one for short and avoid calls. The label is the count up to 9, then
+; withtwoCharacterLabels: trueand the library'stwo_character_bar_marks_labelsfeatureset, up to 99. The tooltip gives the exact count. - Marks are drawn for resolutions of one hour or longer that divide a day, for any number of days, for one week, and for 1 to 12 months; other resolutions get
unsupported_interval. - A symbol with an exchange session or a time zone other than UTC (a stock) is drawn too. The script reads the times of the bars your datafeed sends to the library, and nothing else of them, and puts the calls on those bars by the rule above. Until a symbol's first bars have come there are no marks (state
idle); when they come, the marks are asked for again, which needsbind(widget). - After you call
bind(widget), clicking a mark opens that bar's calls for that side indetails. - Without
ticker, the script reads the symbol's name:BINANCE:BTCUSDT,BTC-USD,BTC/USDT:USDTandBTC-PERPall read as BTC,NVDAas NVDA. - Options:
widgetId,datafeed(required),ticker(a symbol, or a function(symbolInfo) => 'BTC'that returns a symbol or null),details,theme,colors,twoCharacterLabels,detailsHeight,detailsMaxHeight,onState,onSelect. Returned:datafeed,bind(widget),refresh(),select(markId),close(),state(),destroy(). States:idle,ready,empty,unsupported_interval,error.
For requests, limits and your page's policy, see Addresses.