List monitor types
curl --request GET \
--url https://tako.com/api/v1/monitor_types \
--header 'X-API-Key: <api-key>'import requests
url = "https://tako.com/api/v1/monitor_types"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://tako.com/api/v1/monitor_types', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tako.com/api/v1/monitor_types",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://tako.com/api/v1/monitor_types"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://tako.com/api/v1/monitor_types")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/monitor_types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"name": "<string>",
"description": "<string>",
"parameters_schema": {},
"lookback_seconds": 123,
"fire_once_only": true,
"subject_schema": {}
}
],
"firing_enabled": true
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Reference Data
List monitor types
Every monitor type you can create, with the JSON Schema its parameters must satisfy
GET
/
v1
/
monitor_types
List monitor types
curl --request GET \
--url https://tako.com/api/v1/monitor_types \
--header 'X-API-Key: <api-key>'import requests
url = "https://tako.com/api/v1/monitor_types"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://tako.com/api/v1/monitor_types', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tako.com/api/v1/monitor_types",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://tako.com/api/v1/monitor_types"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://tako.com/api/v1/monitor_types")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/monitor_types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"name": "<string>",
"description": "<string>",
"parameters_schema": {},
"lookback_seconds": 123,
"fire_once_only": true,
"subject_schema": {}
}
],
"firing_enabled": true
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Notes
- To authenticate, you’ll need a Tako API key. It’s best practice to store it as an environment variable to avoid hardcoding sensitive credentials in your code.
- Start here. A monitor’s
parametersare validated against its type’s schema, so read the type before you call Create a monitor. This response is the authoritative list — the table below orients you, but a type added since this page was written appears only in the response. - Each item carries
parameters_schema(the JSON Schemaparametersmust satisfy),description(what the type watches and when it fires),lookback_seconds(how far back an occurrence may have happened and still fire),subject_schema(the shape of the resolved subject the type echoes back), andfire_once_only. firing_enabledreports whether this environment runs the rail that evaluates monitors. While it’sfalse, Create a monitor still accepts a monitor and the monitor staysactive, but nothing evaluates it and nothing fires.
The registered types
Type names are namespaceddomain.subtype.
| Type | Fires when |
|---|---|
stocks.pct_change | A stock’s move over your window reaches threshold percent in direction. The move is measured from the reference close at the start of the window, not from the price when you created the monitor. |
stocks.crosses | A stock’s price crosses the level you set, measured against the prior session’s close. A close sitting exactly on the level hasn’t passed it. |
stocks.new_52w_extreme | A stock passes the highest or lowest daily close of the 365 days before the current session, in direction. The extreme has to be passed, not matched. |
sports.game_start | A game for the team you watch starts. Stamped at the scheduled start, so a monitor created after that time never fires for that game — even if the real start was delayed. |
sports.game_result | A game for the team you watch ends in your outcome, by at least margin when you set one. A tie matches neither outcome. |
sports.score_event | The team you watch scores, while a game is live or final. The opponent scoring doesn’t fire it. NBA teams aren’t accepted — watch those with sports.game_result. |
sports.odds_crosses | A named game’s line reaches the level you set. |
stocks.pct_change and stocks.new_52w_extreme are state alerts: a monitor you create while its condition already holds fires on the first bar that ends after creation, not only on a later change. On a delayed feed, that bar arrives as late as the feed’s delay.Finding a subject
The three team types take ateam_id and sports.odds_crosses takes a game_id. Both come from List sports games — a row’s home.id and away.id are team ids, and its id is the game id.Authorizations
Response
Every registered monitor type