dd626dc272756de0503d657989fcddeb31eb2638
bpi-stock-price-scraper
Web server API to fetch latest BPI PPR stock prices on demand.
Features
- REST API endpoints to get latest prices for BPI Destino PPR funds
- Returns price data as JSON
- Dockerized for easy deployment
- Health check endpoint included
Available Symbols
BPIDEST2040- BPI Destino PPR 2040BPIDEST2050- BPI Destino PPR 2050
API Endpoints
GET /- API information and usage examplesGET /health- Health check with available symbolsGET /price/:symbol- Get latest price for a specific symbol
Example Response
{
"symbol": "BPIDEST2040",
"name": "BPI Destino PPR 2040",
"price": 7.73313,
"date": "2026-04-09",
"timestamp": "2026-04-10T16:11:25.850Z"
}
Usage
Docker (Recommended)
Build and run with docker-compose:
docker compose up -d
Or build and run manually:
docker build -t bpi-stock-price-scraper .
docker run -p 3000:3000 bpi-stock-price-scraper
Node.js
Install dependencies and run:
npm install
npm start
For development with auto-reload:
npm run dev
Configuration
The server runs on port 3000 by default. You can change it via the PORT environment variable:
PORT=8080 npm start
Or in docker-compose.yml:
environment:
- PORT=8080
ports:
- "8080:8080"
Testing
Test the API:
# Get API info
curl http://localhost:3000/
# Check health
curl http://localhost:3000/health
# Get latest price
curl http://localhost:3000/price/BPIDEST2040
Description
Languages
TypeScript
86.6%
Dockerfile
11.5%
JavaScript
1.9%