https://github.com/ginarea/gobybit
Bybit API client library for Go (ByBit API connector)
https://github.com/ginarea/gobybit
bybit bybit-api bybit-api-client bybit-api-go bybit-apis bybit-client bybit-go bybit-rest bybit-websocket github go golang trading trading-bot
Last synced: 6 months ago
JSON representation
Bybit API client library for Go (ByBit API connector)
- Host: GitHub
- URL: https://github.com/ginarea/gobybit
- Owner: GinArea
- License: mit
- Created: 2022-09-28T15:19:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-22T10:09:04.000Z (8 months ago)
- Last Synced: 2025-05-22T11:26:27.813Z (8 months ago)
- Topics: bybit, bybit-api, bybit-api-client, bybit-api-go, bybit-apis, bybit-client, bybit-go, bybit-rest, bybit-websocket, github, go, golang, trading, trading-bot
- Language: Go
- Homepage: https://pkg.go.dev/github.com/ginarea/gobybit
- Size: 325 KB
- Stars: 11
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gobybit
gobybit is a [Go](https://go.dev) module for using the [ByBit's](https://bybit.com) Rest & Websocket API
### Documentation
Full API, examples, and implementation notes are available in the Go
documentation.
[](https://pkg.go.dev/github.com/ginarea/gobybit)
### Installation
go get github.com/ginarea/gobybit@latest
### Import
import "github.com/ginarea/gobybit/bybitv5"
### Example
```
package main
import (
"fmt"
"reflect"
"github.com/ginarea/gobybit/bybitv5"
)
func main() {
apiKey := "XXXXX"
apiSecret := "XXXXX"
client := bybitv5.NewClient().WithAuth(apiKey, apiSecret)
responce(client.GetInstruments(bybitv5.GetInstruments{
Category: bybitv5.Inverse,
Symbol: "BTCUSD",
}))
responce(client.GetTickers(bybitv5.GetTickers{
Category: bybitv5.Inverse,
Symbol: "ETHUSD",
}))
responce(client.GetOrderbook(bybitv5.GetOrderbook{
Category: bybitv5.Spot,
Symbol: "ETHUSDT",
}))
}
func responce[T any](r bybitv5.Response[T]) {
fmt.Printf("%v: %+v\n", reflect.TypeOf(r), r)
}
```