WebNumbr API

Simply change the url you use to access your numbr and you can do neat things.
  • All commands are seperated by .
  • All parameters are wrapped by ()
  • You can read the plugin sources
  • Order of operations (all selectors, "do SQL", all operations, all formats, "do output")

Selectors: These choose which piece of data you want.

name params doc example
default Default is "all" webnumbrs
above number=17 Lower bound on value. Accepts any number that SQL can understand yhoo.above(17)
all Selects the whole data history webnumbrs.all.print_r
at date=May 2 1984 Exact match on date. Same as .latest.to(date).from(date) webnumbrs.at(1234567890)
below number=15 Upper bound on value. Accepts any number that SQL can understand yhoo.below(15)
from date=May 2 1984 Lower bound on date. Accepts unixtime or anything strtotime accepts. webnumbrs.from(last week)
last count=1 Selects the last count entries. count defaults to 1 webnumbrs.last(5).graph
latest Selects the latest number. Equivilent to last(count=1) but will always return just a number. webnumbrs.latest.text
sample Turns a query into a random sample webnumbrs.last(10).sample.print_r
to date=+1 day Upper bound on date. Accepts unixtime or anything strtotime accepts. webnumbrs.to(3 months ago)

Operations: These are evaluated in order and are chained together.

name params doc example
average points=24 Smooths the numbers by summing adjacent points. Useful after a derivative webnumbrs.derivative.average(6)
count Simply counts the number of data points webnumbrs.all.count.text
debug Turns on debug information. Changes return structure to {"debug":{},"data":[]} webnumbrs.debug.print_r
derivative numtimes=1 Performs the discrete derivative on the data. Good for seeing change in the data webnumbrs.all.derivative.graph
join Takes current data and creates array(name => data, param1_name = param1_data, ...) .join(dji-nyse.all,nasdaq.all,yhoo.all).graph
max num=91 Only return values under (and including) this amount. (Use this instead of below() when you already did some processing on the data, like a derivative). webnumbrs.max(200)
min num=-5 Only return values over (and including) this amount. (Use this instead of above() when you already did some processing on the data, like a derivative). webnumbrs.min(900)
normalize max=10 Normalizes the values from 0 to 1. webnumbrs.derivative.normalize.min(0.05)
numbr Shows all the numbr information.Changes return structure to {"numbr":{},"data":[]} webnumbrs.numbr.print_r
remote url=http:/​/​webnumbr.com/​numbrPlugins/​operation/​remote/​remote_example.txt Remote plugins. 3 inputs are passed in "c, data, params". Expects string for "data" or 2 outputs in json "c, data". Allowed params are url (the remote endpoint), and url_encoded (a percent encoded url if needed, which takes precedence). {"data":3.14159,"c":{"key":"value"}} webnumbrs.remote(http:/​/​webnumbr.com/​numbrPlugins/​operation/​remote/​remote_example.txt)
sum numtimes=1 Sums up the numbers. slashdot-poll-votes.sum

Formats: Output encoding. Can be chained.

name params doc example
default A basic "Numbr Page" showing information on a numbr. Only really useful for numbrs without operations done on them. webnumbrs
csv CSV. timestamp,value\n webnumbrs.csv
embed Embed code. Uses javascript to keep the numbr current. webnumbrs.all.graph.embed
graph min=10,max=20 Displays a graph. Great for combining with .all webnumbrs.all.graph
gvis timestamp=false Google visualization data source for timeline http:/​/​savedbythegoog.appspot.com/​?id=f87fd49bf81b997796ca96ba4e318a7da4334365
json callback=cb JSON. Good for AJAX requests webnumbrs.from(yesterday).json
link Renders your number as a link back here. Nice for embedding. webnumbrs.latest.link
print_r PHP's print_r. Nice for seeing data with whitespace webnumbrs.debug.print_r
rss count=10, all=true Simple RSS feed webnumbrs.rss
text Raw text printout. Good for easy use of a single number webnumbrs.latest.text
xml XML. Not recommended. Use only if required webnumbrs.from(last week).xml