Code Example
All examples below use the stock endpoints. To query another market, replace stock in the path with japan / india / korea / taiwan / crypto / common.
Every endpoint authenticates through the apiKey request header.
Latest Trade
GET /stock/batch_trade/{codes}
package main
import (
"fmt"
"io"
"net/http"
"time"
)
func main() {
// Comma-separated, up to 100 symbols
apiURL := "https://data.infoway.io/stock/batch_trade/TSLA.US,AAPL.US"
req, err := http.NewRequest("GET", apiURL, nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Accept", "application/json")
req.Header.Set("apiKey", "yourApikey")
client := &http.Client{Timeout: 10 * time.Second}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response:", err)
return
}
fmt.Printf("HTTP code: %d\n", resp.StatusCode)
fmt.Printf("message: %s\n", body)
}Market Depth
GET /stock/batch_depth/{codes}
Candlestick (Historical / Real-time)
POST /stock/v2/batch_kline
Last updated
