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. Tako validates a monitor’s
parametersagainst its type’s schema, so read the type before you call Create a monitor. This response is the authoritative list, and a type added since this page was written appears only in the response. - Each item returns
parameters_schema, the JSON Schema thatparametersmust 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 returns; andfire_once_only. firing_enabledreports whether this environment 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. Tako measures the move 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 closes on the far side of your level from the prior session’s close. A close that lands 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 price has to pass the extreme; matching it doesn’t fire. |
crypto.crosses | A crypto asset’s price in USD reaches your level in direction. It fires once. If the latest snapshot has already reached the level, the create fails, so the monitor always arms on the near side. |
forex.crosses | A currency pair’s rate reaches your level in direction. The level is in the quote currency per one unit of the base, so a EUR/USD level of 1.15 is 1.15 US dollars per euro. Tako compares against the closing mid-rate, and the feed runs up to 30 minutes behind. It fires once. If the rate has already reached the level, the create fails. |
sports.game_start | A game starts, the first time the feed reports it in play. Tako stamps the firing at the scheduled start, so a monitor you create after that time never fires for that game, even when the real start was delayed. |
sports.game_result | A game ends. On a team, it fires only when the result matches your outcome, by at least margin when you set one. On a whole game, it fires with the winner and accepts neither outcome nor margin. A tie matches neither outcome. |
sports.score_event | A score rises while a game is live or final. On a team, only that team’s scoring fires it. On a whole game, either side’s does. NBA teams and games aren’t accepted. |
sports.odds_crosses | A game’s betting line at the book you choose reaches your level in direction. |
stocks.pct_change and stocks.new_52w_extreme are state alerts. If you create one while its condition already holds, the next price update fires it. On a delayed feed, that update arrives as late as the feed’s delay.Naming a subject
Each family names its subject a different way.| Type | Subject fields |
|---|---|
stocks.* | ticker, plus exchange as an ISO 10383 MIC when the ticker is listed on more than one exchange. |
crypto.crosses | ticker, or coinmarketcap_id to identify an asset outside the top-ranked set. Tako rejects an asset ranked outside the top 1000. |
forex.crosses | base and quote, each an ISO 4217 currency code, such as EUR and USD. |
sports.game_start, sports.game_result, sports.score_event | game_id, team_id, or both. |
sports.odds_crosses | game_id and team_id, both required. |
game_idalone watches the whole game, and a firing reports both sides.team_idalone follows that team’s games as they come.- Both together watch that team’s side of that one game.
id is the game id, and its home.id and away.id are team ids.
What a firing sends
Each type sends its own set ofpayload fields to your notification channels. For the fields, see Webhook deliveries.Authorizations
Response
Every registered monitor type