Package kalshi provides a Go implementation of the Kalshi API.
go get github.com/ammario/kalshi
Supports:
- Streaming market data feed
- All core API endpoints
- Rate-limits
- Cursor-based pagination
See the _test.go files for more examples.
func main() {
client := New(kalshi.APIProdURL)
ctx := context.Background()
err := client.Login(
ctx,
"jill@live.com", "hunter12",
)
if err != nil {
panic(err)
}
defer client.Logout(ctx)
// Get all S&P 500 markets.
markets, err := client.Markets(ctx, kalshi.MarketsRequest{
SeriesTicker: "INX"
})
if err != nil {
panic(err)
}
for _, market := range markets {
fmt.Println("found market", market)
}
}kalshi supports all Market endpoints.
| Endpoint | Support Status |
|---|---|
| GetSeries | β |
| GetEvent | β |
| GetMarkets | β |
| GetTrades | β |
| GetMarket | β |
| GetMarketHistory | β |
| GetMarketOrderbook | β |
| GetSeries | β |
kalshi supports all Exchange endpoints.
| Endpoint | Support Status |
|---|---|
| GetExchangeSchedule | β |
| GetExchangeStatus | β |
kalshi supports all Auth endpoints.
| Endpoint | Support Status |
|---|---|
| Login | β |
| Logout | β |
kalshi has mixed support for Portfolio endpoints.
| Endpoint | Support Status |
|---|---|
| GetBalance | β |
| GetFills | β |
| GetOrders | β |
| CreateOrder | β |
| GetOrder | β |
| CancelOrder | β |
| BatchCreateOrders | β |
| BatchCancelOrders | β |
| DecreaseOrder | β |
| GetPositions | β |
| GetPortolioSettlements | β |
Market Data Feed is supported, although it hasn't been thoroughly tested. You may open a feed through (*Client).OpenFeed().