Stroid is a web application for checking stock, foreign exchange, and cryptocurrency prices through a simple interface. Enter a ticker symbol to display the current price, change, volume, and market time using data from Yahoo Finance. For stocks, pre-market or after-hours prices are also shown when available.
The frontend is built with HTML, CSS, and JavaScript. The price API is implemented in Python using yfinance. Bottle is used for local development, while the production setup uses GitHub Pages and AWS Lambda.
- Search stock, foreign exchange, and cryptocurrency prices
- Display the current price, change, percentage change, volume, and market time
- Display pre-market and after-hours information for stocks
- Shortcuts for BTC/USD, ETH/USD, and USD/JPY
- Save and load a ticker symbol in the browser
- Compact interface for both desktop and mobile devices
https://berochlu.github.io/stroid/
.
├── public/ # Static frontend
│ ├── index.html
│ └── static/
│ ├── script.js
│ ├── style.css
│ └── favicon.png
├── lambda/
│ └── lambda_function.py # API for AWS Lambda
├── local_test.py # Local Bottle server
├── requirements.txt # Python dependencies
├── run_Windows.bat # Windows startup script
└── .github/workflows/
└── stroid-deploy-pages.yml # Workflow that deploys public/ to GitHub Pages
- Python 3 (uses
zoneinfo) - Internet connection
Yahoo Finance must be reachable to retrieve price data.
pip install -r requirements.txt
python local_test.pyAfter the server starts, open http://127.0.0.1:5400 in your browser.
The server listens on 0.0.0.0:5400. To access it from another device on the same network, use the Network URL displayed at startup.
- Enter a Yahoo Finance ticker symbol in the input field.
- Press
updateor the Enter key. - If needed, press
saveto store the ticker in browser LocalStorage andloadto restore it.
Examples:
| Asset | Ticker |
|---|---|
| Apple | AAPL |
| Toyota Motor | 7203.T |
| Bitcoin / USD | BTC-USD |
| Ethereum / USD | ETH-USD |
| USD / JPY | JPY=X |
The BTC, ETH, and $/¥ buttons place the corresponding ticker in the input field. Press update afterward to retrieve the price.
The local server provides the following GET endpoints.
GET /api/quote?t=AAPL
GET /quote?t=AAPLExample:
curl "http://127.0.0.1:5400/api/quote?t=AAPL"Example response:
{
"ticker": "AAPL",
"title": "Apple Inc. (AAPL)",
"price": "210.50",
"priceChange": "+1.25",
"priceChangePercent": "(+0.60%)",
"marketTime": "July 28 at 04:00:00 PM EDT",
"volume": "Vol: 45,000,000",
"postPrice": "210.80",
"postPriceChange": "+0.30",
"postPriceChangePercent": "(+0.14%)",
"postMarketTime": "July 28 at 07:59:00 PM EDT"
}Values are formatted as strings for display. If after-hours data or volume is unavailable, the corresponding fields are null.
| Status | Condition |
|---|---|
200 |
The price was retrieved successfully |
400 |
The t query parameter is missing |
500 |
The ticker was not found or the external data request failed |
In production, public/ is hosted on GitHub Pages, and lambda/lambda_function.py is called through an AWS Lambda Function URL.
- Handler:
lambda_function.lambda_handler - Runtime: Python 3.13
- Dependency:
yfinance - Input: the
tquery parameter of the Function URL
When deploying to Lambda, include lambda_function.py and its dependencies in the deployment package, or add the dependencies as a Lambda Layer. CORS must also be configured so the Function URL can accept browser requests.
For detailed instructions on building and setting up the Lambda Layer, see AWS Lambda Layer Setup.
The frontend endpoint is selected by getApiUrl() in public/static/script.js. If the hostname or Lambda Function URL changes, update this function as well.
.github/workflows/stroid-deploy-pages.yml automatically deploys the contents of public/ to GitHub Pages on every push to the main branch.
Note: This workflow deploys only the static frontend files. lambda/lambda_function.py must be deployed to Lambda separately.
local_test.pyandlambda/lambda_function.pycontain the same price retrieval logic. Update both when changing retrieved fields or formatting.- Displayed prices and times depend on data available from Yahoo Finance; real-time accuracy and completeness are not guaranteed.
- After-hours trading is not checked for cryptocurrencies or foreign exchange.
