TTSQL
curl --request POST \
--url https://api.linqalpha.com/v1/ttsql \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data @- <<EOF
{
"query": "Show me NVIDIA's quarterly revenue and net income for 2024"
}
EOFimport requests
url = "https://api.linqalpha.com/v1/ttsql"
payload = { "query": "Show me NVIDIA's quarterly revenue and net income for 2024" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'Show me NVIDIA\'s quarterly revenue and net income for 2024'})
};
fetch('https://api.linqalpha.com/v1/ttsql', 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://api.linqalpha.com/v1/ttsql",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'Show me NVIDIA\'s quarterly revenue and net income for 2024'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.linqalpha.com/v1/ttsql"
payload := strings.NewReader("{\n \"query\": \"Show me NVIDIA's quarterly revenue and net income for 2024\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.linqalpha.com/v1/ttsql")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Show me NVIDIA's quarterly revenue and net income for 2024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linqalpha.com/v1/ttsql")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Show me NVIDIA's quarterly revenue and net income for 2024\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"success": true,
"message": "success",
"response": {
"execution_id": "2548d578-0446-4abc-b6f6-f50c966d341c",
"stock_name_mapping": {
"BBG001S5TZJ6": "NVIDIA Corporation"
},
"currency_info": [
{
"currency": "USD",
"exchange_rate": 1
}
],
"field_currency_info": {
"BBG001S6Q004": {
"SALES": "TWD",
"EPS": "TWD",
"ff_sales": "TWD"
}
},
"execution_duration": 171,
"date_range": [
"2024-01-01",
"2024-12-31"
],
"rdb_result": "### Company Annual Financials\n\n| name | Fiscal Period End Date | Dividends Per Share |\n| --- | --- | --- |\n| NVIDIA Corporation | 2024-01-31 | 0.016 |"
}
}{
"error": {
"code": "INVALID_REQUEST_BODY",
"msg": "query is required and must be a string",
"message": "query is required and must be a string"
},
"payload": "<unknown>"
}{
"error": {
"code": "API_KEY_MISSING",
"msg": "header does not contain api key",
"message": "header does not contain api key"
},
"payload": null
}{
"error": {
"code": "INVALID_REQUEST_BODY",
"msg": "query is required and must be a string",
"message": "query is required and must be a string"
},
"payload": "<unknown>"
}Basic
TTSQL
Converts natural language query to SQL, executes it, and returns results in markdown format
POST
/
v1
/
ttsql
TTSQL
curl --request POST \
--url https://api.linqalpha.com/v1/ttsql \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data @- <<EOF
{
"query": "Show me NVIDIA's quarterly revenue and net income for 2024"
}
EOFimport requests
url = "https://api.linqalpha.com/v1/ttsql"
payload = { "query": "Show me NVIDIA's quarterly revenue and net income for 2024" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'Show me NVIDIA\'s quarterly revenue and net income for 2024'})
};
fetch('https://api.linqalpha.com/v1/ttsql', 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://api.linqalpha.com/v1/ttsql",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'Show me NVIDIA\'s quarterly revenue and net income for 2024'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.linqalpha.com/v1/ttsql"
payload := strings.NewReader("{\n \"query\": \"Show me NVIDIA's quarterly revenue and net income for 2024\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.linqalpha.com/v1/ttsql")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"Show me NVIDIA's quarterly revenue and net income for 2024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linqalpha.com/v1/ttsql")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"Show me NVIDIA's quarterly revenue and net income for 2024\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"success": true,
"message": "success",
"response": {
"execution_id": "2548d578-0446-4abc-b6f6-f50c966d341c",
"stock_name_mapping": {
"BBG001S5TZJ6": "NVIDIA Corporation"
},
"currency_info": [
{
"currency": "USD",
"exchange_rate": 1
}
],
"field_currency_info": {
"BBG001S6Q004": {
"SALES": "TWD",
"EPS": "TWD",
"ff_sales": "TWD"
}
},
"execution_duration": 171,
"date_range": [
"2024-01-01",
"2024-12-31"
],
"rdb_result": "### Company Annual Financials\n\n| name | Fiscal Period End Date | Dividends Per Share |\n| --- | --- | --- |\n| NVIDIA Corporation | 2024-01-31 | 0.016 |"
}
}{
"error": {
"code": "INVALID_REQUEST_BODY",
"msg": "query is required and must be a string",
"message": "query is required and must be a string"
},
"payload": "<unknown>"
}{
"error": {
"code": "API_KEY_MISSING",
"msg": "header does not contain api key",
"message": "header does not contain api key"
},
"payload": null
}{
"error": {
"code": "INVALID_REQUEST_BODY",
"msg": "query is required and must be a string",
"message": "query is required and must be a string"
},
"payload": "<unknown>"
}Earnings-call schedule fields. These fields are returned only for
organizations entitled to earnings-call schedule retrieval and are omitted
entirely for all others. For an entitled organization, every successful
response includes both
earnings_schedule (array) and
earnings_schedule_truncated (bool) — they are [] and false when the query
isn’t about earnings-call dates. For a schedule query (e.g. “When does Apple
next report?”), rdb_result carries the same schedule as markdown text and
earnings_schedule is its structured form (the two are always returned together,
not one instead of the other). Upcoming dates that are still vendor projections
(not yet confirmed) are flagged is_estimated: true.Authorizations
Body
application/json
Natural language query to be converted to SQL
Example:
"Show me NVIDIA's quarterly revenue and net income for 2024"
Was this page helpful?
⌘I