This document describes the REST API for RobinHook, including endpoints, request/response examples, error codes, and rate limits.
- Interactive Swagger UI:
http://localhost:8000/docs - OpenAPI JSON:
http://localhost:8000/openapi.json
GET /prices/latest
Query Parameters:
symbol(string, required): Stock symbol (e.g.,AAPL)provider(string, optional, default:yfinance): Data provider (yfinance,alpha_vantage,finnhub)
Example Request:
GET /prices/latest?symbol=AAPL&provider=yfinanceExample Response:
{
"symbol": "AAPL",
"price": 150.25,
"provider": "yfinance",
"timestamp": "2024-06-15T10:30:00Z"
}
Error Responses:
404 Not Found: No data found for symbol 422 Unprocessable Entity: Missing required query parameter
POST /prices/poll
Request Body:
{
"symbols": ["AAPL", "MSFT"],
"interval": 60,
"provider": "alpha_vantage"
}symbols(array of string, required): List of stock symbolsinterval(integer, required): Polling interval in secondsprovider(string, required): Data provider
Example Response (202 Accepted):
{
"job_id": "poll_123",
"status": "accepted",
"config": {
"symbols": ["AAPL", "MSFT"],
"interval": 60,
"provider": "alpha_vantage"
}
}Error Responses:
422 Unprocessable Entity: Invalid or missing fields
400 Bad Request: Unsupported provider