Skip to main content
GET
/
api
/
months
Get Available Months
curl --request GET \
  --url https://api.example.com/api/months
{
  "success": false,
  "error": "Database connection failed"
}

Endpoint

GET /api/months

Authentication

Requires OAuth 2.0 authentication via session cookies.

Parameters

None

Response

success
boolean
required
Indicates if the request was successful
months
array
required
List of month objects
data_source
string
required
Database source (always “postgresql”)

Example

curl -X GET https://your-domain.com/api/months \
  -H "Cookie: session=your_session_cookie"

Response Example

{
  "success": true,
  "months": [
    {
      "month": "2024-08",
      "total_return_with_dividends": 1250.75
    },
    {
      "month": "2024-07",
      "total_return_with_dividends": -320.50
    },
    {
      "month": "2024-06",
      "total_return_with_dividends": 890.25
    }
  ],
  "data_source": "postgresql"
}

Error Responses

{
  "success": false,
  "error": "Database connection failed"
}
{
  "success": false,
  "error": "Authentication required",
  "redirect_to_login": true
}