Stock API
An API for stock prices and percentage changes in real-time for specified tickers. No need for API keys or signing up anywhere.
Exchange rates
We do now support exchanges rates with data from the European Central Bank. Check the specific docs here.
Usage
We only have one GET endpoint open currently. But if you have more wishes on how we can improve it, just ping us here.
How to fetch information:
await fetch(`https://stocks.algobook.info/api/v1/stocks?tickers=AAPL,MSFT`);
Response
[ { "ticker": "AAPL", "open": 164.59, "lastClose": 165.56, "lastPrice": 165.21, "percentage": -0.21, "currency": "USD", "companyName": "Apple Inc." }, { "ticker": "MSFT", "open": 287, "lastClose": 289.84, "lastPrice": 286.14, "percentage": -1.28, "currency": "USD", "companyName": "Microsoft Corporation" } ]
Data explanation
- ticker is the ticker name provided in request
- open is the last opening price
- lastClose is the previous days closing price
- lastPrice is the last price, if market is open, this will change every 15 minute
- percentage is the current percentage change
- currency is the currency the stock is being traded with
- companyName is the company name
Ticker not found reponse
If one or more tickers cannot be found, we include it in the payload with error data.
[ { "ticker": "AAPL", "open": 164.59, "lastClose": 165.56, "lastPrice": 165.21, "percentage": -0.21, "currency": "USD", "companyName": "Apple Inc." }, { "error": "ERR_BAD_REQUEST", "ticker": "SOME-NON-EXISTING-TICKER" } ]
Summary
As said, this API was created very quickly to give us some data to work with doing our guides and tutorials. If you want more features, please reach out!