Get Timeframe Data
curl --request GET \
--url https://api.example.com/api/timeframe-dataimport requests
url = "https://api.example.com/api/timeframe-data"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/timeframe-data', 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.example.com/api/timeframe-data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/timeframe-data"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/timeframe-data")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/timeframe-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyTrading Data
Get Timeframe Data
Retrieves trading analysis data for a custom timeframe or all-time data
GET
/
api
/
timeframe-data
Get Timeframe Data
curl --request GET \
--url https://api.example.com/api/timeframe-dataimport requests
url = "https://api.example.com/api/timeframe-data"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/timeframe-data', 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.example.com/api/timeframe-data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/timeframe-data"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/timeframe-data")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/timeframe-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyEndpoint
GET /api/timeframe-data
Query Parameters
string
Start date in YYYY-MM-DD format (optional if using all=true)
string
End date in YYYY-MM-DD format (optional if using all=true)
string
Set to “true” for all-time data (ignores start/end dates)
string
Comma-separated list of stock symbols to filter by (optional)
Response
Returns summary, weekly breakdown, monthly breakdown, and open positions.Example
curl -X GET "https://your-domain.com/api/timeframe-data?start=2024-01-01&end=2024-08-31"
curl -X GET "https://your-domain.com/api/timeframe-data?all=true"
curl -X GET "https://your-domain.com/api/timeframe-data?start=2024-06-01&end=2024-08-31&symbols=AAPL,TSLA,MSFT"
// Get YTD data
const start = '2024-01-01';
const end = new Date().toISOString().split('T')[0];
const response = await fetch(`/api/timeframe-data?start=${start}&end=${end}`);
const data = await response.json();
console.log('Total P/L:', data.summary.trading_profit_loss);
Response Example
{
"success": true,
"data": {
"summary": {
"trading_profit_loss": 2450.75,
"total_dividends": 380.50,
"total_trades": 45,
"winning_trades": 28,
"win_rate_percentage": 62.22
},
"weekly_summary": [
{
"week_start": "2024-08-26",
"period": "2024-08-26",
"trading_profit_loss": 150.25,
"total_dividends": 25.00,
"total_trades": 3,
"winning_trades": 2,
"win_rate_percentage": 66.67
}
],
"monthly_summary": [
{
"month_start": "2024-08-01",
"period": "2024-08",
"trading_profit_loss": 850.75,
"total_dividends": 125.50,
"total_trades": 15,
"winning_trades": 9,
"win_rate_percentage": 60.0
}
],
"open_positions": [
{
"symbol": "NVDA",
"shares": 150
}
]
},
"data_source": "postgresql"
}
Was this page helpful?
⌘I