This is the API to get the stock price from KLSE and SGX markets. You are required to deploy this API service into AWS Lambda (serverless, FaaS) before using it.
- Install the serverless toolkit.
- Configure your AWS profile in CLI.
- Run
make
- Deploy to AWS Lambda by running
sls deploy
curl -X GET \
https://xxxxxxxxxx.execute-api.ap-southeast-1.amazonaws.com/dev/stocks/sgx/stock_c6l-sia \
-H 'Cache-Control: no-cache' \
-H 'Postman-Token: ecb056ba-bfe0-4e3b-93e1-b305f3ae5245'
{
"price": 10.69
}
- Visit https://klse.i3investor.com.
- Browse the stock that you are looking for.
- Copy the ID from the URL. Eg. http://klse.i3investor.com/servlets/stk/7054.jsp copy the
7054
- Form the GET request URL like this
https://xxxxxxxxxx.execute-api.ap-southeast-1.amazonaws.com/dev/stocks/klse/7054
- Get the price in the response.
- Visit https://sginvestors.io.
- Browse the stock that you are looking for.
- Copy the ID from the URL. Eg. https://sginvestors.io/sgx/stock/z74-singtel/stock-info copy the
stock/z74-singtel
- Form the GET request URL like this
https://xxxxxxxxxx.execute-api.ap-southeast-1.amazonaws.com/dev/stocks/sgx/stock_z74-singtel
(Replace the/
with_
) - Get the price in the response.
Stock API is MIT licensed.