Unofficial client library for AKSES-KSEI
Unstable proof of concept
- Login with username and (salted) password
- Cache token on disk with auto relogin when expired
- Get balance overview
- Get balance for Equities, Mutual Funds, Bonds, and "Others"
- Get cash balance
- Command-line interface
Get it as dependency
go get -u github.com/chickenzord/gokseiExample usages:
import "github.com/chickenzord/goksei"
func main() {
username := "myemail@domain.com"
password := "myinsecurepassword"
plainPassword := true
authStore, err := goksei.NewFileAuthStore(".goksei-auth")
if err != nil {
panic(err)
}
client := goksei.NewClient(goksei.ClientOpts{
Username: username,
Password: password,
PlainPassword: plainPassword,
AuthStore: authStore,
})
equityBalance, err := client.GetShareBalances(goksei.EquityType)
if err != nil {
panic(err)
}
// ...
}Create .env file with following content:
GOKSEI_USERNAME=youremail@domain.com
GOKSEI_PASSWORD=yoursaltedpasswordThe salted password can be obtained by logging in with your account on https://akses.ksei.co.id/login and inspect the request payload sent by JS code.
(New feature) Alternatively, you can also supply your plaintext password in GOKSEI_PASSWORD then set GOKSEI_PLAIN_PASSWORD to true. Goksei will automate the hashing process for every login attempts.
GOKSEI_USERNAME=youremail@domain.com
GOKSEI_PASSWORD=yourplainpassword
GOKSEI_PLAIN_PASSWORD=trueThen you can run the example using this command:
cd ./cmd/example
go run .This project is only for personal and educational purpose. Use on your own risk, there is no guarantee this project will always work when KSEI changed their API or policies.