Search the data graph
curl --request GET \
--url https://tako.com/api/v1/graph/search \
--header 'X-API-Key: <api-key>'import requests
url = "https://tako.com/api/v1/graph/search"
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/graph/search', 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/graph/search",
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/graph/search"
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/graph/search")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/graph/search")
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{
"results": [
{
"id": "<string>",
"type": "metric",
"name": "<string>",
"aliases": [
"<string>"
],
"description": "<string>",
"subtype": "Companies",
"label": "PERSON"
}
],
"inferred_labels": [
"PERSON"
]
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Data Graph
Graph Search
Resolve a metric or entity in Tako’s data graph by name
GET
/
v1
/
graph
/
search
Search the data graph
curl --request GET \
--url https://tako.com/api/v1/graph/search \
--header 'X-API-Key: <api-key>'import requests
url = "https://tako.com/api/v1/graph/search"
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/graph/search', 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/graph/search",
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/graph/search"
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/graph/search")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tako.com/api/v1/graph/search")
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{
"results": [
{
"id": "<string>",
"type": "metric",
"name": "<string>",
"aliases": [
"<string>"
],
"description": "<string>",
"subtype": "Companies",
"label": "PERSON"
}
],
"inferred_labels": [
"PERSON"
]
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}{
"error_message": "<string>",
"error_type": "BAD_REQUEST"
}Notes
- Authenticated, no credits — send the same
X-API-Keyheader as every Tako endpoint. Graph calls consume no credits; rate limits are 180/minute and 10,000/day. - Use graph search to discover and confirm what data exists before you query it. Resolve the metric and the entity you care about here, then ask Search (
/v3/search) or Answer (/v1/answer) for that specific entity + metric combination — and pin the resolved ids viasources.data.node_ids. - Each result is a
GraphNodewhoseidyou can pass straight to Graph Related to explore what it connects to.
Scoping with types
types is a comma-separated list of facets to return. Omit it to search both:
metric— a measure (e.g. “GDP”, “stock price”).entity— a thing the metric is tracked for (e.g. a country, a company).
Steering the ranking with label
Many names are homonyms — “Air China” contains a country’s name, so the airline competes with China itself in the results. Pass label to bias the ranking toward one entity category. It is a boost, not a filter — matching nodes rank higher, but off-label nodes still return:
# The airline, not the country
curl "https://tako.com/api/v1/graph/search?q=air%20china&label=ORG" \
-H "X-API-Key: $TAKO_API_KEY"
- Values:
PERSON,ORG,GPE,LOC,PRODUCT,EVENT,LANGUAGE,MONEY,METRIC,STOCK_TICKER,WEBSITE. Sports teams areORG. An unknown value is a400. - Auto-inference is on by default (
infer_label=true): with no explicitlabel, Tako detects the entities inqand applies the matching boost. The labels it found come back ininferred_labels— an empty list means inference ran and found nothing; the key is absent when inference didn’t run. Disable withinfer_label=false(also0/no/off); passing an explicitlabelalso disables inference. - Each node reports its own
labelandsubtype(e.g.Countries,Companies) in the response — read them to pick the right node rather than assuming the list is filtered.
A
q shorter than 2 characters returns an empty results list (200, not an error), and limit above 50 is clamped rather than rejected.Example response
The response to thelabel=ORG call above — the airline now outranks the country:
{
"results": [
{
"id": "ent::air_china_limited::6af29d2b",
"type": "entity",
"name": "Air China Limited",
"aliases": ["Air China", "Air China Ltd.", "CCA"],
"description": "Air China Limited, together with its subsidiaries, provides air passenger, air cargo, and airline-related services…",
"subtype": "Companies",
"label": "ORG"
}
]
}
Authorizations
Query Parameters
Search text (min 1 char).
Minimum string length:
1Facets to include. Defaults to metric and entity.
Available options:
metric, entity Max results (default 20, max 50).
Required range:
x >= 1Prefer results with this NER label (boost, not a filter — matching nodes rank higher; others still return). Supplying label disables inference.
Available options:
PERSON, ORG, GPE, LOC, PRODUCT, EVENT, LANGUAGE, MONEY, METRIC, STOCK_TICKER, WEBSITE When true, Tako NER infers the label and grounded-node boosts from q. Set false to disable. Tako ignores this parameter when you supply label. Default true.
Response
Matching metrics and entities
Show child attributes
Show child attributes
Labels that Tako NER inferred from q when infer_label ran (boost applied). An empty list means inference ran and found nothing. The field is absent when you supplied an explicit label, when infer_label=false, or when there was no q.
Available options:
PERSON, ORG, GPE, LOC, PRODUCT, EVENT, LANGUAGE, MONEY, METRIC, STOCK_TICKER, WEBSITE