This API provides two public endpoints you can call from browsers or servers to get stock information and a simple evaluation signal. Responses are JSON and served with CORS enabled for convenience.
If deployed at https://api.lokiclarke.com the API exposes friendly endpoints at /stocks/{symbol} and /evaluate/{symbol} (no /.netlify/functions prefix required). Examples below use the production base URL; replace with your local dev server when testing.
/stock/{symbol})Returns a quick quote for a stock ticker. The singular form /stock is supported as an alias. You can also call the Netlify function path directly: /.netlify/functions/stock/{symbol}, or pass the symbol as a query parameter ?symbol=TSLA.
{symbol} — required, stock ticker (e.g., TSLA).Example (curl):
curl "https://api.lokiclarke.com/stocks/TSLA" curl "https://api.lokiclarke.com/stock/TSLA"
Response (200):
{
"symbol": "TSLA",
"name": "Tesla, Inc.",
"price": 123.45,
"exchange": "NSDQ"
}
Possible errors:
Compares a game API / CSV price with a real price and returns a simple signal.
/evaluate/TSLA or use query ?ticker=TSLA.threshold — numeric dollar threshold for signaling (default 5).Example (curl):
curl "https://api.lokiclarke.com/evaluate/TSLA?threshold=2.5"
Response (200):
{
"ticker": "TSLA",
"gamePrice": 120.5,
"realPrice": 123.45,
"diff": 2.95,
"diffPercent": 2.449,
"signal": "buy"
}
Possible errors:
Currently these endpoints are public and do not require authentication. They may call upstream services (third-party APIs) which have their own rate limits; treat heavy automated polling as unsupported. If you need API keys or higher rate limits, contact the site owner.
Responses include Access-Control-Allow-Origin: * so you can call them directly from browser-based apps for testing or small projects.
Errors return JSON with an error message and sometimes additional fields. Example:
{
"error": "Ticker not found",
"ticker": "FOO"
}
If you find issues or want additional endpoints (batch quotes, historical data, alerts), open an issue in the repository or email the site owner at support@lokiclarke.com.
For suggestions, support requests, or to report bugs, contact support@lokiclarke.com. Expect a reply within 48 hours.
Notes for developers: the implementation files are functions/stock.js and functions/evaluate.js. They read data.csv and call external APIs; exact upstream behaviour may change responses.