curl
curl -sS "https://api.stockcontext.com/v1/tools/stock_search" \
-H "X-API-Key: $STOCKCONTEXT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"AAPL","limit":5,"schema":2}'import requests
url = "https://api.stockcontext.com/v1/tools/stock_search"
payload = {
"query": "AAPL",
"limit": 5,
"schema": 2
}
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: 'AAPL', limit: 5, schema: 2})
};
fetch('https://api.stockcontext.com/v1/tools/stock_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://api.stockcontext.com/v1/tools/stock_search",
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' => 'AAPL',
'limit' => 5,
'schema' => 2
]),
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.stockcontext.com/v1/tools/stock_search"
payload := strings.NewReader("{\n \"query\": \"AAPL\",\n \"limit\": 5,\n \"schema\": 2\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.stockcontext.com/v1/tools/stock_search")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"AAPL\",\n \"limit\": 5,\n \"schema\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stockcontext.com/v1/tools/stock_search")
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\": \"AAPL\",\n \"limit\": 5,\n \"schema\": 2\n}"
response = http.request(request)
puts response.read_body{
"data": {
"query": "AAPL",
"items": [
{
"ticker": "AAPL",
"is_covered": true,
"entity": {
"cik": "0000320193",
"name": "Apple Inc."
},
"coverage": {
"stock_financials": {
"available": true
},
"stock_prices": {
"available": true
}
}
}
]
},
"meta": {
"schema_version": "2"
}
}
Discovery
Stock symbol search
Resolve a ticker, company name, or CIK to securities with per-tool coverage flags.
POST
/
v1
/
tools
/
stock_search
curl
curl -sS "https://api.stockcontext.com/v1/tools/stock_search" \
-H "X-API-Key: $STOCKCONTEXT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"AAPL","limit":5,"schema":2}'import requests
url = "https://api.stockcontext.com/v1/tools/stock_search"
payload = {
"query": "AAPL",
"limit": 5,
"schema": 2
}
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: 'AAPL', limit: 5, schema: 2})
};
fetch('https://api.stockcontext.com/v1/tools/stock_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://api.stockcontext.com/v1/tools/stock_search",
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' => 'AAPL',
'limit' => 5,
'schema' => 2
]),
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.stockcontext.com/v1/tools/stock_search"
payload := strings.NewReader("{\n \"query\": \"AAPL\",\n \"limit\": 5,\n \"schema\": 2\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.stockcontext.com/v1/tools/stock_search")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"AAPL\",\n \"limit\": 5,\n \"schema\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stockcontext.com/v1/tools/stock_search")
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\": \"AAPL\",\n \"limit\": 5,\n \"schema\": 2\n}"
response = http.request(request)
puts response.read_body{
"data": {
"query": "AAPL",
"items": [
{
"ticker": "AAPL",
"is_covered": true,
"entity": {
"cik": "0000320193",
"name": "Apple Inc."
},
"coverage": {
"stock_financials": {
"available": true
},
"stock_prices": {
"available": true
}
}
}
]
},
"meta": {
"schema_version": "2"
}
}
Authorizations
Body
application/json
Request body for stock_search. The model requires exactly one of query or q.
Canonical schema-2 search term. Send exactly one of query or q.
Required string length:
1 - 128Schema-1 search term alias. Send exactly one of q or query.
Required string length:
1 - 128Maximum matches to return.
Required range:
1 <= x <= 50Response schema selector. Omit (or send 2) for the schema-2 envelope, the default; 1 selects the frozen legacy wire. Boolean values are rejected by the API boundary.
Available options:
1, 2 Response
Resolve securities by ticker, company name, or CIK. Envelope-level schema; captured examples remain authoritative for full nested payload detail.
Schema-2 envelope. The OpenAPI schema is structural; captured examples are authoritative for full nested payload detail.