Go SDK for the nof1.ai account totals, trades and conversations endpoints.
It wraps the public API into typed models, request helpers, filters and ready-to-run examples so that you can build dashboards, automations or CLI tooling in minutes.
go get github.com/dm-vev/nof1apipackage main
import (
"context"
"fmt"
"github.com/dm-vev/nof1api"
)
func main() {
client := nof1api.NewClient()
resp, err := client.AccountTotals(context.Background(), nof1api.WithLastMarker(200))
if err != nil {
panic(err)
}
fmt.Printf("Last marker: %d\n", resp.LastHourlyMarkerRead)
for _, account := range resp.AccountTotals {
fmt.Printf("%s equity=%.2f PnL=%.2f%%\n", account.ModelID, account.DollarEquity, account.CumPnLPct)
}
// Fetch the latest realized trades and print profitable ones.
tradesResp, err := client.Trades(context.Background())
if err != nil {
panic(err)
}
for _, trade := range nof1api.FilterTrades(tradesResp.Trades, nof1api.TradeNetPnLAtLeast(100)) {
fmt.Printf("%s %s %.2f USD\n", trade.ModelID, trade.Symbol, trade.RealizedNetPnL)
}
conversationsResp, err := client.Conversations(context.Background())
if err != nil {
panic(err)
}
for _, conv := range conversationsResp.Conversations {
fmt.Printf("%s skill=%s signals=%d\n", conv.ID, conv.Skill, len(conv.LLMResponse))
}
}All examples live inside cmd/:
cmd/example: fetch totals starting from a marker and print everything with filters.cmd/lastmarker: print only the latest marker (good for schedulers).cmd/modelpositions: load a single model (configured viaNOF1_MODEL_ID) and show profitable longs.cmd/trades: list recent trades and filter them withNOF1_MODEL_ID,NOF1_SYMBOLandNOF1_MIN_REALIZED_PNLenv vars.
Run any example with go run ./cmd/<name>.
gofmt -w .
go test ./...PRs and issues welcome!