Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
guneyin authored Oct 25, 2024
1 parent d8ae148 commit 036f31c
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,13 @@ This project aims to provide some useful tools to fetch stock data for BIST via

## Usage and Example

### Create Client
```go
bist, err := gobist.New()
if err != nil {
log.Fatal(err)
}
```

### Get Quote
```go
q, err := bist.GetQuote([]string{"TUPRS"})
if err != nil {
log.Fatal(err)
}
```

### Example
```go
func main() {
bist := gobist.New()

t, _ := time.Parse(time.DateOnly, "2024-09-25")
q, err := bist.GetQuoteWithHistory([]string{"TUPRS", "BIMAS", "VESBE", "THYAO"}, t)
dt, _ := time.Parse(time.DateOnly, "2024-09-25")
q, err := bist.GetQuoteWithHistory([]string{"TUPRS", "BIMAS", "VESBE", "THYAO"}, dt)
if err != nil {
log.Fatal(err)
}
Expand All @@ -41,4 +25,4 @@ func main() {
fmt.Println(fmt.Sprintf("symbol=%s name=%s price=%f, history_price=%f, change=%f", item.Symbol, item.Name, item.Price, item.History.Price, item.History.Change.ByRatio))
}
}
```
```

0 comments on commit 036f31c

Please sign in to comment.