Batch Calendar Returns
curl --request POST \
--url https://api.fruitstand.dev/v1/calendar-returns/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"codes": [
"<string>"
],
"market": "US",
"year": 123
}
'import requests
url = "https://api.fruitstand.dev/v1/calendar-returns/batch"
payload = {
"codes": ["<string>"],
"market": "US",
"year": 123
}
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({codes: ['<string>'], market: 'US', year: 123})
};
fetch('https://api.fruitstand.dev/v1/calendar-returns/batch', 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.fruitstand.dev/v1/calendar-returns/batch",
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([
'codes' => [
'<string>'
],
'market' => 'US',
'year' => 123
]),
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://api.fruitstand.dev/v1/calendar-returns/batch"
payload := strings.NewReader("{\n \"codes\": [\n \"<string>\"\n ],\n \"market\": \"US\",\n \"year\": 123\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://api.fruitstand.dev/v1/calendar-returns/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"codes\": [\n \"<string>\"\n ],\n \"market\": \"US\",\n \"year\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fruitstand.dev/v1/calendar-returns/batch")
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 \"codes\": [\n \"<string>\"\n ],\n \"market\": \"US\",\n \"year\": 123\n}"
response = http.request(request)
puts response.read_body[
{
"code": "<string>",
"calendar_year": 123,
"market": "US",
"base_date": "2023-12-25",
"end_date": "2023-12-25",
"calendar_year_return": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Fund Returns API
Batch Calendar Returns
Latest (or ?year) calendar-year return for up to batch_max_codes funds in one call.
POST
/
v1
/
calendar-returns
/
batch
Batch Calendar Returns
curl --request POST \
--url https://api.fruitstand.dev/v1/calendar-returns/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"codes": [
"<string>"
],
"market": "US",
"year": 123
}
'import requests
url = "https://api.fruitstand.dev/v1/calendar-returns/batch"
payload = {
"codes": ["<string>"],
"market": "US",
"year": 123
}
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({codes: ['<string>'], market: 'US', year: 123})
};
fetch('https://api.fruitstand.dev/v1/calendar-returns/batch', 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.fruitstand.dev/v1/calendar-returns/batch",
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([
'codes' => [
'<string>'
],
'market' => 'US',
'year' => 123
]),
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://api.fruitstand.dev/v1/calendar-returns/batch"
payload := strings.NewReader("{\n \"codes\": [\n \"<string>\"\n ],\n \"market\": \"US\",\n \"year\": 123\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://api.fruitstand.dev/v1/calendar-returns/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"codes\": [\n \"<string>\"\n ],\n \"market\": \"US\",\n \"year\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fruitstand.dev/v1/calendar-returns/batch")
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 \"codes\": [\n \"<string>\"\n ],\n \"market\": \"US\",\n \"year\": 123\n}"
response = http.request(request)
puts response.read_body[
{
"code": "<string>",
"calendar_year": 123,
"market": "US",
"base_date": "2023-12-25",
"end_date": "2023-12-25",
"calendar_year_return": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Your Fruit Stand API key from app.fruitstand.dev.
Body
application/json
Bare tickers, e.g. ['SPY', 'QQQ'].
Minimum array length:
1Market/exchange code for the funds. Defaults to US; informational and does not affect lookups (codes are bare tickers). Reserved for future multi-market support.
Return each fund's row for this year. Omit for each fund's latest.
Was this page helpful?