Ծրագրավորողներ

Ստեղծեք MardRisk-ի հիման վրա — API փաստաթղթեր, SDK և ինտեգրման ուղեցույցներ։

Authentication

All API requests require a valid API key passed via the X-API-Key header or as a Bearer token:

X-API-Key: mr_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Generate keys in the API Keys tab.

POST /api/chat
Send a message to the MardRisk AI financial assistant. Supports Q&A, financial analysis, and agentic execution.
curl -X POST https://mardrisk.ai/api/chat \ -H "X-API-Key: mr_live_...your_key..." \ -H "Content-Type: application/json" \ -d '{ "message": "What is the current exchange rate for USD/AMD?", "mode": "regular" }'
POST /api/chat
Agentic mode — triggers autonomous analysis: Monte Carlo simulation, live web search, financial forecasting.
curl -X POST https://mardrisk.ai/api/chat \ -H "X-API-Key: mr_live_...your_key..." \ -H "Content-Type: application/json" \ -d '{ "message": "Run a Monte Carlo simulation on a $500K portfolio with 60/30/10 stocks/bonds/crypto allocation", "mode": "simulation" }'
GET /api/finance/status
Get system status and available finance data sources.
curl -H "X-API-Key: mr_live_...your_key..." https://mardrisk.ai/api/finance/status
GET /api/finance/market-data
Aggregated market data — indices, forex, crypto, commodities.
curl -H "X-API-Key: mr_live_...your_key..." https://mardrisk.ai/api/finance/market-data
POST /api/finance/forecast
AI-powered price forecast for any ticker symbol (stocks, crypto, indices).
curl -X POST https://mardrisk.ai/api/finance/forecast \ -H "X-API-Key: mr_live_...your_key..." \ -H "Content-Type: application/json" \ -d '{"symbol": "AAPL", "horizon_days": 30}'
GET /api/community/posts
List community posts with optional tag filtering and pagination.
curl "https://mardrisk.ai/api/community/posts?page=1&tags=stocks,mutual_funds" \ -H "X-API-Key: mr_live_...your_key..."
POST /api/community/posts
Create a new discussion post in the community.
curl -X POST https://mardrisk.ai/api/community/posts \ -H "X-API-Key: mr_live_...your_key..." \ -H "Content-Type: application/json" \ -d '{"title": "Market Analysis", "content": "Thoughts on Q3 earnings?", "tags": "stocks,analysis"}'
GET /api/auth/me
Get the current authenticated user's profile.
curl -H "X-API-Key: mr_live_...your_key..." https://mardrisk.ai/api/auth/me
POST /api/finance/risk-score
Calculate a financial risk score based on income, debt, assets, and market conditions.
curl -X POST https://mardrisk.ai/api/finance/risk-score \ -H "X-API-Key: mr_live_...your_key..." \ -H "Content-Type: application/json" \ -d '{"income": 50000, "debt": 15000, "savings": 20000}'