https://github.com/chickenzord/goksei
Unofficial client library for AKSES-KSEI
https://github.com/chickenzord/goksei
go golang indonesia stock-data
Last synced: 2 months ago
JSON representation
Unofficial client library for AKSES-KSEI
- Host: GitHub
- URL: https://github.com/chickenzord/goksei
- Owner: chickenzord
- License: mit
- Created: 2023-02-13T13:47:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-24T05:51:06.000Z (7 months ago)
- Last Synced: 2025-08-03T12:43:17.828Z (3 months ago)
- Topics: go, golang, indonesia, stock-data
- Language: Go
- Homepage:
- Size: 104 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goksei
Unofficial client library for AKSES-KSEI
[](https://pkg.go.dev/github.com/chickenzord/goksei)
[](https://goreportcard.com/report/github.com/chickenzord/goksei)## Project status
Unstable proof of concept
## Features
- [x] Login with username and (salted) password
- [x] Cache token on disk with auto relogin when expired
- [x] Get balance overview
- [x] Get balance for Equities, Mutual Funds, Bonds, and "Others"
- [x] Get cash balance
- [ ] Command-line interface## Using as library
Get it as dependency
```sh
go get -u github.com/chickenzord/goksei
```Example usages:
```go
import "github.com/chickenzord/goksei"
func main() {
username := "myemail@domain.com"
password := "myinsecurepassword"
plainPassword := trueauthStore, 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)
}// ...
}```
## Trying out the example
Create `.env` file with following content:
```sh
GOKSEI_USERNAME=youremail@domain.com
GOKSEI_PASSWORD=yoursaltedpassword
```The 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.
```sh
GOKSEI_USERNAME=youremail@domain.com
GOKSEI_PASSWORD=yourplainpassword
GOKSEI_PLAIN_PASSWORD=true
```Then you can run the example using this command:
```sh
cd ./cmd/example
go run .
```## Disclaimer
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.