curl --request POST \
--url https://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"filters": {
"types": [],
"tickers": [
"NSE:OLECTRA"
],
"sectors": [
"<string>"
],
"industries": [
"<string>"
],
"years": [
"<string>"
],
"quarters": []
},
"top_k": 10
}
'import requests
url = "https://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search"
payload = {
"query": "<string>",
"filters": {
"types": [],
"tickers": ["NSE:OLECTRA"],
"sectors": ["<string>"],
"industries": ["<string>"],
"years": ["<string>"],
"quarters": []
},
"top_k": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
filters: {
types: [],
tickers: ['NSE:OLECTRA'],
sectors: ['<string>'],
industries: ['<string>'],
years: ['<string>'],
quarters: []
},
top_k: 10
})
};
fetch('https://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-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://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-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' => '<string>',
'filters' => [
'types' => [
],
'tickers' => [
'NSE:OLECTRA'
],
'sectors' => [
'<string>'
],
'industries' => [
'<string>'
],
'years' => [
'<string>'
],
'quarters' => [
]
],
'top_k' => 10
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"filters\": {\n \"types\": [],\n \"tickers\": [\n \"NSE:OLECTRA\"\n ],\n \"sectors\": [\n \"<string>\"\n ],\n \"industries\": [\n \"<string>\"\n ],\n \"years\": [\n \"<string>\"\n ],\n \"quarters\": []\n },\n \"top_k\": 10\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"filters\": {\n \"types\": [],\n \"tickers\": [\n \"NSE:OLECTRA\"\n ],\n \"sectors\": [\n \"<string>\"\n ],\n \"industries\": [\n \"<string>\"\n ],\n \"years\": [\n \"<string>\"\n ],\n \"quarters\": []\n },\n \"top_k\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"filters\": {\n \"types\": [],\n \"tickers\": [\n \"NSE:OLECTRA\"\n ],\n \"sectors\": [\n \"<string>\"\n ],\n \"industries\": [\n \"<string>\"\n ],\n \"years\": [\n \"<string>\"\n ],\n \"quarters\": []\n },\n \"top_k\": 10\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": [
{
"text": "<string>",
"metadata": {
"chunk_num": "<string>"
},
"document": {
"type": "<string>",
"published_date": "2023-11-07T05:31:56Z",
"year": "<string>",
"link": "<string>"
},
"company": {
"id": "<string>",
"company_name": "<string>",
"ticker": "<string>",
"exchange_tickers": [
{
"ticker": "<string>",
"id": "<string>",
"url": "<string>"
}
]
},
"similarity_score": 123
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"message": "<string>"
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"message": "<string>"
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"message": "<string>"
}
]
}Filings Embeddings Search
The Filings Embeddings Search API retrieves the nearest chunks of text (based on semantic similarity) from our database for specified filings (earnings transcripts and annual reports) for any given user query/prompt in natural langauge. Users can utilize this functionality for various purposes, such as building an AI-search engine, AI-tagging, etc., using the associated text from these filings.
curl --request POST \
--url https://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"filters": {
"types": [],
"tickers": [
"NSE:OLECTRA"
],
"sectors": [
"<string>"
],
"industries": [
"<string>"
],
"years": [
"<string>"
],
"quarters": []
},
"top_k": 10
}
'import requests
url = "https://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search"
payload = {
"query": "<string>",
"filters": {
"types": [],
"tickers": ["NSE:OLECTRA"],
"sectors": ["<string>"],
"industries": ["<string>"],
"years": ["<string>"],
"quarters": []
},
"top_k": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
filters: {
types: [],
tickers: ['NSE:OLECTRA'],
sectors: ['<string>'],
industries: ['<string>'],
years: ['<string>'],
quarters: []
},
top_k: 10
})
};
fetch('https://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-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://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-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' => '<string>',
'filters' => [
'types' => [
],
'tickers' => [
'NSE:OLECTRA'
],
'sectors' => [
'<string>'
],
'industries' => [
'<string>'
],
'years' => [
'<string>'
],
'quarters' => [
]
],
'top_k' => 10
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"filters\": {\n \"types\": [],\n \"tickers\": [\n \"NSE:OLECTRA\"\n ],\n \"sectors\": [\n \"<string>\"\n ],\n \"industries\": [\n \"<string>\"\n ],\n \"years\": [\n \"<string>\"\n ],\n \"quarters\": []\n },\n \"top_k\": 10\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"filters\": {\n \"types\": [],\n \"tickers\": [\n \"NSE:OLECTRA\"\n ],\n \"sectors\": [\n \"<string>\"\n ],\n \"industries\": [\n \"<string>\"\n ],\n \"years\": [\n \"<string>\"\n ],\n \"quarters\": []\n },\n \"top_k\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stockinsights-ai-main-95a26a0.zuplo.app/api/in/v0/documents/embeddings-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"filters\": {\n \"types\": [],\n \"tickers\": [\n \"NSE:OLECTRA\"\n ],\n \"sectors\": [\n \"<string>\"\n ],\n \"industries\": [\n \"<string>\"\n ],\n \"years\": [\n \"<string>\"\n ],\n \"quarters\": []\n },\n \"top_k\": 10\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": [
{
"text": "<string>",
"metadata": {
"chunk_num": "<string>"
},
"document": {
"type": "<string>",
"published_date": "2023-11-07T05:31:56Z",
"year": "<string>",
"link": "<string>"
},
"company": {
"id": "<string>",
"company_name": "<string>",
"ticker": "<string>",
"exchange_tickers": [
{
"ticker": "<string>",
"id": "<string>",
"url": "<string>"
}
]
},
"similarity_score": 123
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"message": "<string>"
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"message": "<string>"
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"message": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The user query in natural language for which similar chunks of filings text is retrieved using OpenAI embeddings.
Filters to narrow the search scope. filters.types is required and must contain at least one filing type.
Show child attributes
Show child attributes
Number of top matching chunks to return in the response. This parameter is optional and defaults to 20 if not specified. Maximum value is 50.
x <= 100