Custom API Documentation
The LED Ticker Custom API allows advanced users to develop a custom ticker to
display any content and customize how the content is displayed. The API works by
defining text or shapes to draw on the Ticker's display. The custom API can be
accessed in multiple ways:
A WebSocket message sent to the Ticker through your local area network (LAN)
An http POST request sent to the Ticker through your local area network (LAN)
An http(s) GET request sent by the Ticker to a url endpoint to fetch data
periodically
API Parameters
The API expects a set of parameters in order to fully define where and how each
text or shape will be displayed.
Text Elements
Parameter Type Required Values Default Value
text String true Up to 16 characters None
size Integer false 1 to 4 2
color String false 000000 to ffffff ffffff
x Integer false 0 to 63 0
y Integer false 0 to 31 7
align String false L, C, or R L
Line Elements
Parameter Type Required Values Default Value
shape String true line None
x1 Integer true 0 to 63 0
y1 Integer true 0 to 31 0
x2 Integer true 0 to 63 0
y2 Integer true 0 to 31 0
color String false 000000 to ffffff ffffff
Rectangle Elements
Parameter Type Required Values Default Value
shape String true rect None
filled Boolean false true or false false
x Integer true 0 to 63 0
y Integer true 0 to 31 0
w Integer true 0 to 63 0
h Integer true 0 to 31 0
color String false 000000 to ffffff ffffff
Circle Elements
Parameter Type Required Values Default Value
shape String true circle None
filled Boolean false true or false false
x Integer true 0 to 63 0
y Integer true 0 to 31 0
r Integer true >0 0
color String false 000000 to ffffff ffffff
Diamond Elements
Parameter Type Required Values Default Value
shape String true diamond None
filled Boolean false true or false false
x Integer true 0 to 63 0
y Integer true 0 to 31 0
w Integer true 0 to 63 0
h Integer true 0 to 31 0
color String false 000000 to ffffff ffffff
Pixel Line Elements
Parameter Type Required Values Default Value
shape String true pixel None
hex String true Up to 16 characters* None
x Integer true 0 to 63 0
y Integer true 0 to 31 0
align String false H or V H
*Color information is encoded as a hex string of up to 8 colors.
Each color is a 2 character wide, 8-bit color hex value encoded as RRRGGGBB.
Below are example 8-bit color hex values:
Color RGB Binary Hex
White 255,255,255 11111111 ff
Red 255,0,0 11100000 e0
Green 0,255,0 00011100 1c
Blue 0,0,255 00000011 03
Yellow 255,255,0 11111100 fc
Cyan 0,255,255 00011111 1f
Magenta 255,0,255 11100011 e3
A line of 8 alternating white and black pixels would be: "ff00ff00ff00ff00"
WebSocket (LAN Only)
The API can be accessed locally by sending a WebSocket message to the Ticker
through your local area network (LAN).
Send the WebSocket message to ws://ticker.local/api (or ws://<IP ADDRESS>/api)
API Parameters must be JSON formatted in the message
A message (may be empty) must be sent every 60 seconds to maintain API display
A "clear" message will clear the screen
A "exit" message will exit from the API display and resume normal Ticker operation
Each API call requires a seperate message
POST Request (LAN Only)
The API can be accessed locally by sending a POST request to the Ticker through
your local area network (LAN).
Send the POST request to http://ticker.local/api (or http://<IP ADDRESS>/api)
API Parameters must be JSON formatted in the body of the request
Alert Message (LAN Only)
The Alert API can be accessed locally by sending a POST request to the Ticker
through your local area network (LAN).
Send the POST request to http://ticker.local/alert (or http://<IP ADDRESS>/alert)
API Parameters must be JSON formatted in the body of the request
Additional alert parameters can be supplied in the URL to define the brightness and
duration of the alert:
Parameter Type Required Values Default Value
length Integer false >0 3 seconds
brightness Integer false 1 to 10 Current Brightness
An example Alert request might be: http://ticker.local/alert?length=5&brightness=10
GET Request
The API can be accessed by having the Ticker send a GET request to a url endpoint.
The Ticker will send a GET request to the url endpoint and at the interval defined
in the Ticker Settings page
The endpoint can be http or https
The endpoint must return a JSON response
JSON Format
Up to 256 total elements may be defined
Elements can be displayed on multiple pages using a nested array
An example single page response might be:
[
{
"text":"Size 1",
"color":"FF0000",
"size":1,
"x":31,
"y":4,
"align":"C"
},
{
"text":"Size 2",
"color":"00FF00",
"size":2,
"x":1,
"y":15,
"align":"L"
},
{
"text":"Size 3",
"color":"0000FF",
"size":3,
"x":62,
"y":15,
"align":"R"
},
{
"text":"Size 4",
"color":"00FF00",
"size":4,
"x":1,
"y":30,
"align":"L"
}
]
The example JSON above will produce the following output on the Ticker display:
An example multi-page response might be:
[
[
{
"text":"Size 1",
"color":"FF0000",
"size":1,
"x":31,
"y":4,
"align":"C"
},
{
"text":"Size 2",
"color":"00FF00",
"size":2,
"x":1,
"y":15,
"align":"L"
}
],
[
{
"text":"Size 3",
"color":"0000FF",
"size":3,
"x":62,
"y":15,
"align":"R"
},
{
"text":"Size 4",
"color":"00FF00",
"size":4,
"x":1,
"y":30,
"align":"L"
}
]
]