Overview
The Trading Analysis Dashboard exposes a RESTful API for accessing trading data, portfolio holdings, and performance metrics programmatically. The API powers the web interface and can be used to build custom integrations or automation tools.Live Application
Visit the Trading Analysis Dashboard at performance.miningwood.com
Base URL
Authentication
All API endpoints require authentication via Google OAuth 2.0. The API uses session-based authentication with HTTP-only cookies set after successful OAuth login.See the Authentication guide for details on the OAuth flow and session management.
API Categories
Trading Data
Access monthly trading data, P&L reports, and individual trade details
Symbols
Get symbol lists, trading statistics, and detailed performance data
Calendar
View daily trading activity, export reports, and market metrics
Portfolio
Manage portfolio holdings and trigger price updates
Data Import
Upload CSV files and view import history
Timeframe Analysis
Query trading performance across custom date ranges
Authentication
OAuth endpoints and session management
Health Checks
Monitor application health and readiness
Response Format
All API responses return JSON with a consistent structure:Success Response
Error Response
Common Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the request was successful |
error | string | Error message (only present on failure) |
data_source | string | Database source (typically “postgresql”) |
redirect_to_login | boolean | Whether client should redirect to login (for 401 errors) |
HTTP Status Codes
The API uses standard HTTP status codes:| Code | Meaning | When Used |
|---|---|---|
200 | OK | Successful request |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Authentication required |
403 | Forbidden | User not authorized |
404 | Not Found | Resource not found |
500 | Internal Server Error | Server-side error |
Rate Limiting
The API does not currently implement rate limiting, but the Finnhub price refresh endpoint is subject to Finnhub’s API rate limits (60 requests/minute for free tier).
Data Types
Date Formats
- Months:
YYYY-MMformat (e.g.,"2024-08") - Dates:
YYYY-MM-DDformat (e.g.,"2024-08-15") - Timestamps: ISO 8601 format (e.g.,
"2024-08-15T14:30:00Z")
Numeric Values
- Prices: Decimal with 2-4 decimal places
- Shares: Integer or decimal (supports fractional shares)
- P&L Values: Decimal with 2 decimal places (can be negative)
- Percentages: Decimal (e.g.,
0.1523for 15.23%)
Example Usage
Fetch Available Trading Months
Get Portfolio Holdings
Analyze Custom Timeframe
Client Libraries
The API can be accessed using any HTTP client library:Data Models
Trade Object
Holding Object
Month Summary Object
Error Handling
Always check thesuccess field before processing response data:
Next Steps
Health Checks
Application monitoring and health endpoints
Authentication
Learn about OAuth flow and session management
Trading Data
Explore trading data endpoints
Symbols
Symbol lists and performance data
Portfolio API
Manage portfolio holdings
Calendar
Daily activity and export reports
Data Import
Upload and track CSV imports
Timeframe Analysis
Query custom date ranges