Get Trailing Returns
curl --request GET \
--url https://api.fruitstand.dev/v1/funds/{code}/trailing-returns \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fruitstand.dev/v1/funds/{code}/trailing-returns"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fruitstand.dev/v1/funds/{code}/trailing-returns', 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/funds/{code}/trailing-returns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.fruitstand.dev/v1/funds/{code}/trailing-returns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fruitstand.dev/v1/funds/{code}/trailing-returns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fruitstand.dev/v1/funds/{code}/trailing-returns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "<string>",
"as_of_date": "2023-12-25",
"market": "US",
"return_1d": "<string>",
"return_1w": "<string>",
"return_1m": "<string>",
"return_3m": "<string>",
"return_6m": "<string>",
"return_ytd": "<string>",
"return_1y": "<string>",
"return_2y": "<string>",
"return_3y": "<string>",
"return_4y": "<string>",
"return_5y": "<string>",
"return_7y": "<string>",
"return_10y": "<string>",
"return_15y": "<string>",
"return_20y": "<string>",
"return_earliest_available": "<string>",
"extra_returns": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Fund Returns API
Get Trailing Returns
GET
/
v1
/
funds
/
{code}
/
trailing-returns
Get Trailing Returns
curl --request GET \
--url https://api.fruitstand.dev/v1/funds/{code}/trailing-returns \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fruitstand.dev/v1/funds/{code}/trailing-returns"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fruitstand.dev/v1/funds/{code}/trailing-returns', 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/funds/{code}/trailing-returns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.fruitstand.dev/v1/funds/{code}/trailing-returns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fruitstand.dev/v1/funds/{code}/trailing-returns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fruitstand.dev/v1/funds/{code}/trailing-returns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "<string>",
"as_of_date": "2023-12-25",
"market": "US",
"return_1d": "<string>",
"return_1w": "<string>",
"return_1m": "<string>",
"return_3m": "<string>",
"return_6m": "<string>",
"return_ytd": "<string>",
"return_1y": "<string>",
"return_2y": "<string>",
"return_3y": "<string>",
"return_4y": "<string>",
"return_5y": "<string>",
"return_7y": "<string>",
"return_10y": "<string>",
"return_15y": "<string>",
"return_20y": "<string>",
"return_earliest_available": "<string>",
"extra_returns": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Your Fruit Stand API key from app.fruitstand.dev.
Path Parameters
Query Parameters
Market/exchange code for the fund. Defaults to US — all funds are currently US-listed and code is a bare ticker (e.g. SPY), so this is informational and does not affect lookups. Reserved for future multi-market support.
As-of date. If it isn't a trading day (weekend/holiday), snaps back to the nearest prior trading day; the response's as_of_date is the actual day returned. Omit for the latest available.
Response
Successful Response
Bare ticker, e.g. SPY.
Market/exchange code. Always US for now.
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Show child attributes
Show child attributes
Was this page helpful?