Magic Price Ticker and the BLP JSON API

Fri 17 July 2009

The guys at Quiet Speculation mentioned a self-updating stock ticker for Magic card prices as another cool feature they would like to see. In the spirit of BLP's stock-like price graphs, I thought the feature was a great fit.

The first iteration of the ticker is below! It requires JavaScript like the embeddable search bar I added a few days ago, but the ticker runs off BLP's new JSON API. The API is publicly accessible, but it's pretty basic at the moment. The API is available at and returns today's top cards, their prices, and their changes from the previous day.

Sample response:


The interface supports JSONP through the jsonp attribute. A request to would return the data wrapped in a call to callback.

JSONP callback:




The ticker can be embedded in any web page using this code. It supports a few basic options right now.

Ticker options:

The number of pixels the content is scrolled at each interval. Default is 2.
The time in milliseconds between each interval. Default is 40.
Whether to hide the three-letter expansion code after the name of each card. Default is false.

Tickers only have a single function: draw. It takes the ID of the element that the ticker should use.