diff --git a/polygon/client_test.go b/polygon/client_test.go new file mode 100644 index 0000000..eaaf249 --- /dev/null +++ b/polygon/client_test.go @@ -0,0 +1,13 @@ +package polygon + +import ( + "os" + "testing" +) + +var ApiKey = os.Getenv("POLYGON_API_KEY") + +func TestClient_GetLatestCandles(t *testing.T) { + client := NewClient("api.polygon.io", ApiKey) + client.GetLatestCandles("EUR-USD") +} diff --git a/twelve_data/client.go b/twelve_data/client.go index dfcdc63..88df72c 100644 --- a/twelve_data/client.go +++ b/twelve_data/client.go @@ -22,7 +22,7 @@ func NewClient(host string, apiKey string) *Client { func (c *Client) GetLatestCandles(symbol string, micCode string) []*data.Candle { client := resty.New() url := fmt.Sprintf( - "https://%s/time_series?symbol=%s&interval=1min&apikey=%s&mic_code=%s", + "https://%s/time_series?symbol=%s&interval=1min&apikey=%s&mic_code=%s&outputsize=5000", c.host, symbol, c.apiKey, micCode, ) resp, err := client.R().Get(url) diff --git a/twelve_data/client_test.go b/twelve_data/client_test.go new file mode 100644 index 0000000..3b3a4a5 --- /dev/null +++ b/twelve_data/client_test.go @@ -0,0 +1,13 @@ +package twelve_data + +import ( + "os" + "testing" +) + +var ApiKey = os.Getenv("TWELVE_DATA_API_KEY") + +func TestClient_GetLatestCandles(t *testing.T) { + client := NewClient("api.twelvedata.com", ApiKey) + client.GetLatestCandles("WTI/USD", "COMMODITY") +}