Get Month Data
curl --request GET \
--url https://api.example.com/api/month/{month}import requests
url = "https://api.example.com/api/month/{month}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/month/{month}', 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/month/{month}",
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/month/{month}"
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/month/{month}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/month/{month}")
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_body{
"success": true,
"summary": {
"month": "<string>",
"total_trades": 123,
"winning_trades": 123,
"win_rate": 123,
"trading_profit_loss": 123,
"total_dividends": 123,
"total_return_with_dividends": 123
},
"trades": [
{}
],
"dividends": [
{}
]
}Trading Data
Get Month Data
Retrieves detailed trading data for a specific month
GET
/
api
/
month
/
{month}
Get Month Data
curl --request GET \
--url https://api.example.com/api/month/{month}import requests
url = "https://api.example.com/api/month/{month}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/month/{month}', 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/month/{month}",
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/month/{month}"
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/month/{month}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/month/{month}")
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_body{
"success": true,
"summary": {
"month": "<string>",
"total_trades": 123,
"winning_trades": 123,
"win_rate": 123,
"trading_profit_loss": 123,
"total_dividends": 123,
"total_return_with_dividends": 123
},
"trades": [
{}
],
"dividends": [
{}
]
}Endpoint
GET /api/month/{month}
Path Parameters
string
required
Month in YYYY-MM format (e.g., “2024-08”)
Authentication
Requires OAuth 2.0 authentication via session cookies.Response
Returns detailed trading data including summary, trades, and dividends.boolean
required
Request success status
object
required
array
required
List of completed trades
array
required
List of dividend payments
Example
curl -X GET https://your-domain.com/api/month/2024-08 \
-H "Cookie: session=your_session_cookie"
const month = '2024-08';
const response = await fetch(`/api/month/${month}`);
const data = await response.json();
if (data.success) {
console.log(`P/L: $${data.summary.trading_profit_loss}`);
console.log(`Trades: ${data.trades.length}`);
}
Response Example
{
"success": true,
"summary": {
"month": "2024-08",
"total_trades": 15,
"winning_trades": 9,
"win_rate": 60.0,
"trading_profit_loss": 850.75,
"total_dividends": 125.50,
"total_return_with_dividends": 976.25
},
"trades": [
{
"symbol": "AAPL",
"buy_date": "2024-08-01",
"sell_date": "2024-08-15",
"buy_price": 195.50,
"sell_price": 198.75,
"volume": 100,
"total_profit_loss": 325.00,
"return_percentage": 1.66,
"trade_result": "Win"
}
],
"dividends": [
{
"transaction_date": "2024-08-15",
"symbol": "MSFT",
"action": "Cash Dividend",
"amount": 75.50
}
],
"data_source": "postgresql"
}
Was this page helpful?
⌘I