-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_generated.go
2155 lines (1938 loc) · 151 KB
/
api_generated.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by go generate; DO NOT EDIT.
// This file was generated on 2023-05-20 13:09:36
// using data from https://www.alphavantage.co/documentation
package alphavantage
import "github.com/jay9909/alphavantage/api"
// Endpoint Category: Commodities
// https://www.alphavantage.co/documentation/#commodities
//
// APIs under this section provide historical data for major commodities such as crude oil, natural gas, copper, wheat, etc., spanning across various temporal horizons (daily, weekly, monthly, quarterly, etc.)
// Crude Oil Prices: West Texas Intermediate (WTI)
// This API returns the West Texas Intermediate (WTI) crude oil prices in daily, weekly, and monthly horizons.
// Source: U.S. Energy Information Administration, Crude Oil Prices: West Texas Intermediate (WTI) - Cushing, Oklahoma, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#wti
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>daily</code>, <code>weekly</code>, and <code>monthly</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetWti(opt_interval, opt_datatype string) api.Response {
function := "WTI"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Crude Oil Prices (Brent)
// This API returns the Brent (Europe) crude oil prices in daily, weekly, and monthly horizons.
// Source: U.S. Energy Information Administration, Crude Oil Prices: Brent - Europe, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#brent
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>daily</code>, <code>weekly</code>, and <code>monthly</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetBrent(opt_interval, opt_datatype string) api.Response {
function := "BRENT"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Natural Gas
// This API returns the Henry Hub natural gas spot prices in daily, weekly, and monthly horizons.
// Source: U.S. Energy Information Administration, Henry Hub Natural Gas Spot Price, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#natural-gas
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>daily</code>, <code>weekly</code>, and <code>monthly</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetNaturalGas(opt_interval, opt_datatype string) api.Response {
function := "NATURAL_GAS"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Global Price of Copper
// This API returns the global price of copper in monthly, quarterly, and annual horizons.
// Source: International Monetary Fund (<a href="https://www.imf.org/external/terms.htm" target="_blank">IMF Terms of Use</a>), Global price of Copper, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#copper
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code>, <code>quarterly</code>, and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetCopper(opt_interval, opt_datatype string) api.Response {
function := "COPPER"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Global Price of Aluminum
// This API returns the global price of aluminum in monthly, quarterly, and annual horizons.
// Source: International Monetary Fund (<a href="https://www.imf.org/external/terms.htm" target="_blank">IMF Terms of Use</a>), Global price of Aluminum, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#aluminum
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code>, <code>quarterly</code>, and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetAluminum(opt_interval, opt_datatype string) api.Response {
function := "ALUMINUM"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Global Price of Wheat
// This API returns the global price of wheat in monthly, quarterly, and annual horizons.
// Source: International Monetary Fund (<a href="https://www.imf.org/external/terms.htm" target="_blank">IMF Terms of Use</a>), Global price of Wheat, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#wheat
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code>, <code>quarterly</code>, and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetWheat(opt_interval, opt_datatype string) api.Response {
function := "WHEAT"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Global Price of Corn
// This API returns the global price of corn in monthly, quarterly, and annual horizons.
// Source: International Monetary Fund (<a href="https://www.imf.org/external/terms.htm" target="_blank">IMF Terms of Use</a>), Global price of Corn, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#corn
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code>, <code>quarterly</code>, and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetCorn(opt_interval, opt_datatype string) api.Response {
function := "CORN"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Global Price of Cotton
// This API returns the global price of cotton in monthly, quarterly, and annual horizons.
// Source: International Monetary Fund (<a href="https://www.imf.org/external/terms.htm" target="_blank">IMF Terms of Use</a>), Global price of Cotton, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#cotton
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code>, <code>quarterly</code>, and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetCotton(opt_interval, opt_datatype string) api.Response {
function := "COTTON"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Global Price of Sugar
// This API returns the global price of sugar in monthly, quarterly, and annual horizons.
// Source: International Monetary Fund (<a href="https://www.imf.org/external/terms.htm" target="_blank">IMF Terms of Use</a>), Global price of Sugar, No. 11, World, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#sugar
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code>, <code>quarterly</code>, and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetSugar(opt_interval, opt_datatype string) api.Response {
function := "SUGAR"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Global Price of Coffee
// This API returns the global price of coffee in monthly, quarterly, and annual horizons.
// Source: International Monetary Fund (<a href="https://www.imf.org/external/terms.htm" target="_blank">IMF Terms of Use</a>), Global price of Coffee, Other Mild Arabica, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#coffee
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code>, <code>quarterly</code>, and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetCoffee(opt_interval, opt_datatype string) api.Response {
function := "COFFEE"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Global Price Index of All Commodities
// This API returns the global price index of all commodities in monthly, quarterly, and annual temporal dimensions.
// Source: International Monetary Fund (<a href="https://www.imf.org/external/terms.htm" target="_blank">IMF Terms of Use</a>), Global Price Index of All Commodities, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#all-commodities
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code>, <code>quarterly</code>, and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetAllCommodities(opt_interval, opt_datatype string) api.Response {
function := "ALL_COMMODITIES"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Endpoint Category: Digital & Crypto Currencies
// https://www.alphavantage.co/documentation/#digital-currency
//
// APIs under this section provide a wide range of data feed for digital and crypto currencies such as Bitcoin.
// [PREMIUM] CRYPTO_INTRADAY
// This API returns intraday time series (timestamp, open, high, low, close, volume) of the cryptocurrency specified, updated realtime.
// https://www.alphavantage.co/documentation/#crypto-intraday
//
// Parameters:
// - symbol: The digital/crypto currency of your choice. It can be any of the currencies in the <a href="https://www.alphavantage.co/digital_currency_list/" target="_blank"> digital currency list</a>. For example: <code>symbol=ETH</code>.
// - market: The exchange market of your choice. It can be any of the market in the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> market list</a>. For example: <code>market=USD</code>.
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>
// - opt_outputsize: By default, <code>outputsize=compact</code>. Strings <code>compact</code> and <code>full</code> are accepted with the following specifications: <code>compact</code> returns only the latest 100 data points in the intraday time series; <code>full</code> returns the full-length intraday time series. The "compact" option is recommended if you would like to reduce the data size of each API call.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the intraday time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetCryptoIntraday(symbol, market, interval, opt_outputsize, opt_datatype string) api.Response {
function := "CRYPTO_INTRADAY"
params := map[string]string{
"symbol": symbol,
"market": market,
"interval": interval,
"outputsize": opt_outputsize,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// DIGITAL_CURRENCY_DAILY
// This API returns the daily historical time series for a digital currency (e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), refreshed daily at midnight (UTC). Prices and volumes are quoted in both the market-specific currency and USD.
// https://www.alphavantage.co/documentation/#currency-daily
//
// Parameters:
// - symbol: The digital/crypto currency of your choice. It can be any of the currencies in the <a href="https://www.alphavantage.co/digital_currency_list/" target="_blank"> digital currency list</a>. For example: <code>symbol=BTC</code>.
// - market: The exchange market of your choice. It can be any of the market in the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> market list</a>. For example: <code>market=CNY</code>.
func (a *Alphavantage) GetDigitalCurrencyDaily(symbol, market string) api.Response {
function := "DIGITAL_CURRENCY_DAILY"
params := map[string]string{
"symbol": symbol,
"market": market,
}
return a.client.Query(function, params)
}
// DIGITAL_CURRENCY_WEEKLY
// This API returns the weekly historical time series for a digital currency (e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), refreshed daily at midnight (UTC). Prices and volumes are quoted in both the market-specific currency and USD.
// https://www.alphavantage.co/documentation/#currency-weekly
//
// Parameters:
// - symbol: The digital/crypto currency of your choice. It can be any of the currencies in the <a href="https://www.alphavantage.co/digital_currency_list/" target="_blank"> digital currency list</a>. For example: <code>symbol=BTC</code>.
// - market: The exchange market of your choice. It can be any of the market in the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> market list</a>. For example: <code>market=CNY</code>.
func (a *Alphavantage) GetDigitalCurrencyWeekly(symbol, market string) api.Response {
function := "DIGITAL_CURRENCY_WEEKLY"
params := map[string]string{
"symbol": symbol,
"market": market,
}
return a.client.Query(function, params)
}
// DIGITAL_CURRENCY_MONTHLY
// This API returns the monthly historical time series for a digital currency (e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), refreshed daily at midnight (UTC). Prices and volumes are quoted in both the market-specific currency and USD.
// https://www.alphavantage.co/documentation/#currency-monthly
//
// Parameters:
// - symbol: The digital/crypto currency of your choice. It can be any of the currencies in the <a href="https://www.alphavantage.co/digital_currency_list/" target="_blank"> digital currency list</a>. For example: <code>symbol=BTC</code>.
// - market: The exchange market of your choice. It can be any of the market in the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> market list</a>. For example: <code>market=CNY</code>.
func (a *Alphavantage) GetDigitalCurrencyMonthly(symbol, market string) api.Response {
function := "DIGITAL_CURRENCY_MONTHLY"
params := map[string]string{
"symbol": symbol,
"market": market,
}
return a.client.Query(function, params)
}
// Endpoint Category: Economic Indicators
// https://www.alphavantage.co/documentation/#economic-indicators
//
// APIs under this section provide key US economic indicators frequently used for investment strategy formulation and application development.
// REAL_GDP
// This API returns the annual and quarterly Real GDP of the United States.
// Source: U.S. Bureau of Economic Analysis, Real Gross Domestic Product, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#real-gdp
//
// Parameters:
// - opt_interval: By default, <code>interval=annual</code>. Strings <code>quarterly</code> and <code>annual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetRealGdp(opt_interval, opt_datatype string) api.Response {
function := "REAL_GDP"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// REAL_GDP_PER_CAPITA
// This API returns the quarterly Real GDP per Capita data of the United States.
// Source: U.S. Bureau of Economic Analysis, Real gross domestic product per capita, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#real-gdp-per-capita
//
// Parameters:
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetRealGdpPerCapita(opt_datatype string) api.Response {
function := "REAL_GDP_PER_CAPITA"
params := map[string]string{
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// TREASURY_YIELD
// This API returns the daily, weekly, and monthly US treasury yield of a given maturity timeline (e.g., 5 year, 30 year, etc).
// Source: Board of Governors of the Federal Reserve System (US), Market Yield on U.S. Treasury Securities at 3-month, 2-year, 5-year, 7-year, 10-year, and 30-year Constant Maturities, Quoted on an Investment Basis, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#treasury-yield
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>daily</code>, <code>weekly</code>, and <code>monthly</code> are accepted.
// - opt_maturity: By default, <code>maturity=10year</code>. Strings <code>3month</code>, <code>2year</code>, <code>5year</code>, <code>7year</code>, <code>10year</code>, and <code>30year</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetTreasuryYield(opt_interval, opt_maturity, opt_datatype string) api.Response {
function := "TREASURY_YIELD"
params := map[string]string{
"interval": opt_interval,
"maturity": opt_maturity,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// FEDERAL_FUNDS_RATE
// This API returns the daily, weekly, and monthly federal funds rate (interest rate) of the United States.
// Source: Board of Governors of the Federal Reserve System (US), Federal Funds Effective Rate, retrieved from FRED, Federal Reserve Bank of St. Louis (https://fred.stlouisfed.org/series/FEDFUNDS). This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#interest-rate
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>daily</code>, <code>weekly</code>, and <code>monthly</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetFederalFundsRate(opt_interval, opt_datatype string) api.Response {
function := "FEDERAL_FUNDS_RATE"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// CPI
// This API returns the monthly and semiannual consumer price index (CPI) of the United States. CPI is widely regarded as the barometer of inflation levels in the broader economy.
// Source: U.S. Bureau of Labor Statistics, Consumer Price Index for All Urban Consumers: All Items in U.S. City Average, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#cpi
//
// Parameters:
// - opt_interval: By default, <code>interval=monthly</code>. Strings <code>monthly</code> and <code>semiannual</code> are accepted.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetCpi(opt_interval, opt_datatype string) api.Response {
function := "CPI"
params := map[string]string{
"interval": opt_interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// INFLATION
// This API returns the annual inflation rates (consumer prices) of the United States.
// Source: World Bank, Inflation, consumer prices for the United States, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#inflation
//
// Parameters:
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetInflation(opt_datatype string) api.Response {
function := "INFLATION"
params := map[string]string{
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// RETAIL_SALES
// This API returns the monthly Advance Retail Sales: Retail Trade data of the United States.
// Source: U.S. Census Bureau, Advance Retail Sales: Retail Trade, retrieved from FRED, Federal Reserve Bank of St. Louis (https://fred.stlouisfed.org/series/RSXFSN). This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#retail-sales
//
// Parameters:
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetRetailSales(opt_datatype string) api.Response {
function := "RETAIL_SALES"
params := map[string]string{
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// DURABLES
// This API returns the monthly manufacturers' new orders of durable goods in the United States.
// Source: U.S. Census Bureau, Manufacturers' New Orders: Durable Goods, retrieved from FRED, Federal Reserve Bank of St. Louis (https://fred.stlouisfed.org/series/UMDMNO). This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#durable-goods
//
// Parameters:
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetDurables(opt_datatype string) api.Response {
function := "DURABLES"
params := map[string]string{
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// UNEMPLOYMENT
// This API returns the monthly unemployment data of the United States. The unemployment rate represents the number of unemployed as a percentage of the labor force. Labor force data are restricted to people 16 years of age and older, who currently reside in 1 of the 50 states or the District of Columbia, who do not reside in institutions (e.g., penal and mental facilities, homes for the aged), and who are not on active duty in the Armed Forces (<a href="https://fred.stlouisfed.org/series/UNRATE" target="_blank">source</a>).
// Source: U.S. Bureau of Labor Statistics, Unemployment Rate, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#unemployment
//
// Parameters:
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetUnemployment(opt_datatype string) api.Response {
function := "UNEMPLOYMENT"
params := map[string]string{
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// NONFARM_PAYROLL
// This API returns the monthly US All Employees: Total Nonfarm (commonly known as Total Nonfarm Payroll), a measure of the number of U.S. workers in the economy that excludes proprietors, private household employees, unpaid volunteers, farm employees, and the unincorporated self-employed.
// Source: U.S. Bureau of Labor Statistics, All Employees, Total Nonfarm, retrieved from FRED, Federal Reserve Bank of St. Louis. This data feed uses the FRED® API but is <u>not</u> endorsed or certified by the Federal Reserve Bank of St. Louis. By using this data feed, you agree to be bound by the <a href="https://fred.stlouisfed.org/docs/api/terms_of_use.html" target="_blank">FRED® API Terms of Use</a>.
// https://www.alphavantage.co/documentation/#nonfarm-payroll
//
// Parameters:
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetNonfarmPayroll(opt_datatype string) api.Response {
function := "NONFARM_PAYROLL"
params := map[string]string{
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Endpoint Category: Fundamental Data
// https://www.alphavantage.co/documentation/#fundamentals
//
// We offer the following set of fundamental data APIs in various temporal dimensions covering key financial metrics, income statements, balance sheets, cash flow, and other fundamental data points.
// Company Overview
// This API returns the company information, financial ratios, and other key metrics for the equity specified. Data is generally refreshed on the same day a company reports its latest earnings and financials.
// https://www.alphavantage.co/documentation/#company-overview
//
// Parameters:
// - symbol: The symbol of the token of your choice. For example: <code>symbol=IBM</code>.
func (a *Alphavantage) GetOverview(symbol string) api.Response {
function := "OVERVIEW"
params := map[string]string{
"symbol": symbol,
}
return a.client.Query(function, params)
}
// INCOME_STATEMENT
// This API returns the annual and quarterly income statements for the company of interest, with normalized fields <a href="https://documentation.alphavantage.co/FundamentalDataDocs/index.html" target="_blank">mapped to GAAP and IFRS taxonomies</a> of the SEC. Data is generally refreshed on the same day a company reports its latest earnings and financials.
// https://www.alphavantage.co/documentation/#income-statement
//
// Parameters:
// - symbol: The symbol of the token of your choice. For example: <code>symbol=IBM</code>.
func (a *Alphavantage) GetIncomeStatement(symbol string) api.Response {
function := "INCOME_STATEMENT"
params := map[string]string{
"symbol": symbol,
}
return a.client.Query(function, params)
}
// BALANCE_SHEET
// This API returns the annual and quarterly balance sheets for the company of interest, with normalized fields <a href="https://documentation.alphavantage.co/FundamentalDataDocs/index.html" target="_blank">mapped to GAAP and IFRS taxonomies</a> of the SEC. Data is generally refreshed on the same day a company reports its latest earnings and financials.
// https://www.alphavantage.co/documentation/#balance-sheet
//
// Parameters:
// - symbol: The symbol of the token of your choice. For example: <code>symbol=IBM</code>.
func (a *Alphavantage) GetBalanceSheet(symbol string) api.Response {
function := "BALANCE_SHEET"
params := map[string]string{
"symbol": symbol,
}
return a.client.Query(function, params)
}
// CASH_FLOW
// This API returns the annual and quarterly cash flow for the company of interest, with normalized fields <a href="https://documentation.alphavantage.co/FundamentalDataDocs/index.html" target="_blank">mapped to GAAP and IFRS taxonomies</a> of the SEC. Data is generally refreshed on the same day a company reports its latest earnings and financials.
// https://www.alphavantage.co/documentation/#cash-flow
//
// Parameters:
// - symbol: The symbol of the token of your choice. For example: <code>symbol=IBM</code>.
func (a *Alphavantage) GetCashFlow(symbol string) api.Response {
function := "CASH_FLOW"
params := map[string]string{
"symbol": symbol,
}
return a.client.Query(function, params)
}
// Earnings
// This API returns the annual and quarterly earnings (EPS) for the company of interest. Quarterly data also includes analyst estimates and surprise metrics.
// https://www.alphavantage.co/documentation/#earnings
//
// Parameters:
// - symbol: The symbol of the token of your choice. For example: <code>symbol=IBM</code>.
func (a *Alphavantage) GetEarnings(symbol string) api.Response {
function := "EARNINGS"
params := map[string]string{
"symbol": symbol,
}
return a.client.Query(function, params)
}
// Listing & Delisting Status
// This API returns a list of active or delisted US stocks and ETFs, either as of the latest trading day or at a specific time in history. The endpoint is positioned to facilitate equity research on asset lifecycle and survivorship.
// https://www.alphavantage.co/documentation/#listing-status
//
// Parameters:
// - opt_date: If no date is set, the API endpoint will return a list of active or delisted symbols as of the latest trading day. If a date is set, the API endpoint will "travel back" in time and return a list of active or delisted symbols on that particular date in history. Any <u>YYYY-MM-DD</u> date later than 2010-01-01 is supported. For example, <code>date=2013-08-03</code>
// - opt_state: By default, <code>state=active</code> and the API will return a list of actively traded stocks and ETFs. Set <code>state=delisted</code> to query a list of delisted assets.
func (a *Alphavantage) GetListingStatus(opt_date, opt_state string) api.Response {
function := "LISTING_STATUS"
params := map[string]string{
"date": opt_date,
"state": opt_state,
}
return a.client.Query(function, params)
}
// Earnings Calendar
// This API returns a list of company earnings expected in the next 3, 6, or 12 months.
// https://www.alphavantage.co/documentation/#earnings-calendar
//
// Parameters:
// - opt_symbol: By default, no symbol will be set for this API. When no symbol is set, the API endpoint will return the full list of company earnings scheduled. If a symbol is set, the API endpoint will return the expected earnings for that specific symbol. For example, <code>symbol=IBM</code>
// - opt_horizon: By default, <code>horizon=3month</code> and the API will return a list of expected company earnings in the next 3 months. You may set <code>horizon=6month</code> or <code>horizon=12month</code> to query the earnings scheduled for the next 6 months or 12 months, respectively.
func (a *Alphavantage) GetEarningsCalendar(opt_symbol, opt_horizon string) api.Response {
function := "EARNINGS_CALENDAR"
params := map[string]string{
"symbol": opt_symbol,
"horizon": opt_horizon,
}
return a.client.Query(function, params)
}
// IPO Calendar
// This API returns a list of IPOs expected in the next 3 months.
// https://www.alphavantage.co/documentation/#ipo-calendar
//
// Parameters:
func (a *Alphavantage) GetIpoCalendar(string) api.Response {
function := "IPO_CALENDAR"
params := map[string]string{}
return a.client.Query(function, params)
}
// Endpoint Category: Foreign Exchange (FX)
// https://www.alphavantage.co/documentation/#fx
//
// APIs under this section provide a wide range of data feed for realtime and historical forex (FX) rates.
// CURRENCY_EXCHANGE_RATE
// This API returns the realtime exchange rate for a pair of digital currency (e.g., Bitcoin) and physical currency (e.g., USD).
// https://www.alphavantage.co/documentation/#currency-exchange
//
// Parameters:
// - from_currency: The currency you would like to get the exchange rate for. It can either be a <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> physical currency</a> or <a href="https://www.alphavantage.co/digital_currency_list/" target="_blank"> digital/crypto currency</a>. For example: <code>from_currency=USD</code> or <code>from_currency=BTC</code>.
// - to_currency: The destination currency for the exchange rate. It can either be a <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> physical currency</a> or <a href="https://www.alphavantage.co/digital_currency_list/" target="_blank"> digital/crypto currency</a>. For example: <code>to_currency=USD</code> or <code>to_currency=BTC</code>.
func (a *Alphavantage) GetCurrencyExchangeRate(from_currency, to_currency string) api.Response {
function := "CURRENCY_EXCHANGE_RATE"
params := map[string]string{
"from_currency": from_currency,
"to_currency": to_currency,
}
return a.client.Query(function, params)
}
// [PREMIUM] FX_INTRADAY
// This API returns intraday time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime.
// https://www.alphavantage.co/documentation/#fx-intraday
//
// Parameters:
// - from_symbol: A three-letter symbol from the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> forex currency list</a>. For example: <code>from_symbol=EUR</code>
// - to_symbol: A three-letter symbol from the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> forex currency list</a>. For example: <code>to_symbol=USD</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>
// - opt_outputsize: By default, <code>outputsize=compact</code>. Strings <code>compact</code> and <code>full</code> are accepted with the following specifications: <code>compact</code> returns only the latest 100 data points in the intraday time series; <code>full</code> returns the full-length intraday time series. The "compact" option is recommended if you would like to reduce the data size of each API call.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the intraday time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetFxIntraday(from_symbol, to_symbol, interval, opt_outputsize, opt_datatype string) api.Response {
function := "FX_INTRADAY"
params := map[string]string{
"from_symbol": from_symbol,
"to_symbol": to_symbol,
"interval": interval,
"outputsize": opt_outputsize,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// FX_DAILY
// This API returns the daily time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime.
// https://www.alphavantage.co/documentation/#fx-daily
//
// Parameters:
// - from_symbol: A three-letter symbol from the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> forex currency list</a>. For example: <code>from_symbol=EUR</code>
// - to_symbol: A three-letter symbol from the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> forex currency list</a>. For example: <code>to_symbol=USD</code>
// - opt_outputsize: By default, <code>outputsize=compact</code>. Strings <code>compact</code> and <code>full</code> are accepted with the following specifications: <code>compact</code> returns only the latest 100 data points in the daily time series; <code>full</code> returns the full-length daily time series. The "compact" option is recommended if you would like to reduce the data size of each API call.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetFxDaily(from_symbol, to_symbol, opt_outputsize, opt_datatype string) api.Response {
function := "FX_DAILY"
params := map[string]string{
"from_symbol": from_symbol,
"to_symbol": to_symbol,
"outputsize": opt_outputsize,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// FX_WEEKLY
// This API returns the weekly time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime.
// The latest data point is the price information for the week (or partial week) containing the current trading day, updated realtime.
// https://www.alphavantage.co/documentation/#fx-weekly
//
// Parameters:
// - from_symbol: A three-letter symbol from the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> forex currency list</a>. For example: <code>from_symbol=EUR</code>
// - to_symbol: A three-letter symbol from the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> forex currency list</a>. For example: <code>to_symbol=USD</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the weekly time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetFxWeekly(from_symbol, to_symbol, opt_datatype string) api.Response {
function := "FX_WEEKLY"
params := map[string]string{
"from_symbol": from_symbol,
"to_symbol": to_symbol,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// FX_MONTHLY
// This API returns the monthly time series (timestamp, open, high, low, close) of the FX currency pair specified, updated realtime.
// The latest data point is the prices information for the month (or partial month) containing the current trading day, updated realtime.
// https://www.alphavantage.co/documentation/#fx-monthly
//
// Parameters:
// - from_symbol: A three-letter symbol from the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> forex currency list</a>. For example: <code>from_symbol=EUR</code>
// - to_symbol: A three-letter symbol from the <a href="https://www.alphavantage.co/physical_currency_list/" target="_blank"> forex currency list</a>. For example: <code>to_symbol=USD</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the monthly time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetFxMonthly(from_symbol, to_symbol, opt_datatype string) api.Response {
function := "FX_MONTHLY"
params := map[string]string{
"from_symbol": from_symbol,
"to_symbol": to_symbol,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// Endpoint Category: Alpha Intelligence™
// https://www.alphavantage.co/documentation/#intelligence
//
// The APIs in this section contain advanced market intelligence built with our decades of expertise in AI, machine learning, and quantitative finance. We hope these highly differentiated alternative datasets can help turbocharge your trading strategy, market research, and financial software application to the next level.
// Market News & Sentiment
// Looking for market news signals to augment your trading strategy, or a global news feed API for your web/mobile app? You've just found it. This API returns live and historical market news & sentiment data derived from over 50 major financial news outlets around the world, covering stocks, cryptocurrencies, forex, and a wide range of topics such as fiscal policy, mergers & acquisitions, IPOs, etc. This API, combined with our core stock API, fundamental data, and technical indicator APIs, can provide you with a 360-degree view of the financial market and the broader economy.
// https://www.alphavantage.co/documentation/#news-sentiment
//
// Parameters:
// - opt_tickers: The stock/crypto/forex symbols of your choice. For example: <code>tickers=IBM</code> will filter for articles that mention the IBM ticker; <code>tickers=COIN,CRYPTO:BTC,FOREX:USD</code> will filter for articles that <u>simultaneously</u> mention Coinbase (COIN), Bitcoin (CRYPTO:BTC), and US Dollar (FOREX:USD) in their content.
// - opt_topics: The news topics of your choice. For example: <code>topics=technology</code> will filter for articles that write about the technology sector; <code>topics=technology,ipo</code> will filter for articles that <u>simultaneously</u> cover technology <u>and</u> IPO in their content. Below is the full list of supported topics:
//
// <li>Blockchain: <code>blockchain</code></li>
// <li>Earnings: <code>earnings</code></li>
// <li>IPO: <code>ipo</code></li>
// <li>Mergers & Acquisitions: <code>mergers_and_acquisitions</code></li>
// <li>Financial Markets: <code>financial_markets</code></li>
// <li>Economy - Fiscal Policy (e.g., tax reform, government spending): <code>economy_fiscal</code></li>
// <li>Economy - Monetary Policy (e.g., interest rates, inflation): <code>economy_monetary</code></li>
// <li>Economy - Macro/Overall: <code>economy_macro</code></li>
// <li>Energy & Transportation: <code>energy_transportation</code></li>
// <li>Finance: <code>finance</code></li>
// <li>Life Sciences: <code>life_sciences</code></li>
// <li>Manufacturing: <code>manufacturing</code></li>
// <li>Real Estate & Construction: <code>real_estate</code></li>
// <li>Retail & Wholesale: <code>retail_wholesale</code></li>
// <li>Technology: <code>technology</code></li>
//
// - opt_time_from: The time range of the news articles you are targeting, in YYYYMMDDTHHMM format. For example: <code>time_from=20220410T0130</code>. If time_from is specified but time_to is missing, the API will return articles published between the time_from value and the current time.
// - opt_sort: By default, <code>sort=LATEST</code> and the API will return the latest articles first. You can also set <code>sort=EARLIEST</code> or <code>sort=RELEVANCE</code> based on your use case.
// - opt_limit: By default, <code>limit=50</code> and the API will return up to 50 matching results. You can also set <code>limit=200</code> to output up to 200 results. If you are looking for an even higher output limit, please contact <a href="/cdn-cgi/l/email-protection" class="__cf_email__">[email protected]</a> to have your limit boosted.
func (a *Alphavantage) GetNewsSentiment(opt_tickers, opt_topics, opt_time_from, opt_sort, opt_limit string) api.Response {
function := "NEWS_SENTIMENT"
params := map[string]string{
"tickers": opt_tickers,
"topics": opt_topics,
"time_from": opt_time_from,
"sort": opt_sort,
"limit": opt_limit,
}
return a.client.Query(function, params)
}
// Endpoint Category: Technical Indicators
// https://www.alphavantage.co/documentation/#technical-indicators
//
// Technical indicator APIs for a given equity or currency exchange pair, derived from the underlying time series based stock API and forex data. All indicators are calculated from adjusted time series data to eliminate artificial price/volume perturbations from historical split and dividend events.
// SMA
// This API returns the simple moving average (SMA) values. See also: <a href="http://www.investopedia.com/articles/technical/052201.asp" target="_blank">Investopedia article</a> and <a href="http://www.fmlabs.com/reference/default.htm?url=SimpleMA.htm" target="_blank">mathematical reference</a>.
// https://www.alphavantage.co/documentation/#sma
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - time_period: Number of data points used to calculate each moving average value. Positive integers are accepted (e.g., <code>time_period=60</code>, <code>time_period=200</code>)
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetSma(symbol, interval, time_period, series_type, opt_datatype string) api.Response {
function := "SMA"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"time_period": time_period,
"series_type": series_type,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// EMA
// This API returns the exponential moving average (EMA) values. See also: <a href="http://www.fmlabs.com/reference/default.htm?url=ExpMA.htm" target="_blank">mathematical reference</a>.
// https://www.alphavantage.co/documentation/#ema
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - time_period: Number of data points used to calculate each moving average value. Positive integers are accepted (e.g., <code>time_period=60</code>, <code>time_period=200</code>)
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetEma(symbol, interval, time_period, series_type, opt_datatype string) api.Response {
function := "EMA"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"time_period": time_period,
"series_type": series_type,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// WMA
// This API returns the weighted moving average (WMA) values. See also: <a href="http://www.fmlabs.com/reference/default.htm?url=WeightedMA.htm" target="_blank">mathematical reference</a>.
// https://www.alphavantage.co/documentation/#wma
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - time_period: Number of data points used to calculate each moving average value. Positive integers are accepted (e.g., <code>time_period=60</code>, <code>time_period=200</code>)
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetWma(symbol, interval, time_period, series_type, opt_datatype string) api.Response {
function := "WMA"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"time_period": time_period,
"series_type": series_type,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// DEMA
// This API returns the double exponential moving average (DEMA) values. See also: <a href="http://www.investopedia.com/articles/trading/10/double-exponential-moving-average.asp" target="_blank">Investopedia article</a> and <a href="http://www.fmlabs.com/reference/default.htm?url=DEMA.htm" target="_blank">mathematical reference</a>.
// https://www.alphavantage.co/documentation/#dema
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - time_period: Number of data points used to calculate each moving average value. Positive integers are accepted (e.g., <code>time_period=60</code>, <code>time_period=200</code>)
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetDema(symbol, interval, time_period, series_type, opt_datatype string) api.Response {
function := "DEMA"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"time_period": time_period,
"series_type": series_type,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// TEMA
// This API returns the triple exponential moving average (TEMA) values. See also: <a href="http://www.fmlabs.com/reference/default.htm?url=TEMA.htm" target="_blank">mathematical reference</a>.
// https://www.alphavantage.co/documentation/#tema
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - time_period: Number of data points used to calculate each moving average value. Positive integers are accepted (e.g., <code>time_period=60</code>, <code>time_period=200</code>)
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetTema(symbol, interval, time_period, series_type, opt_datatype string) api.Response {
function := "TEMA"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"time_period": time_period,
"series_type": series_type,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// TRIMA
// This API returns the triangular moving average (TRIMA) values. See also: <a href="http://www.fmlabs.com/reference/default.htm?url=TriangularMA.htm" target="_blank">mathematical reference</a>.
// https://www.alphavantage.co/documentation/#trima
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - time_period: Number of data points used to calculate each moving average value. Positive integers are accepted (e.g., <code>time_period=60</code>, <code>time_period=200</code>)
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetTrima(symbol, interval, time_period, series_type, opt_datatype string) api.Response {
function := "TRIMA"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"time_period": time_period,
"series_type": series_type,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// KAMA
// This API returns the Kaufman adaptive moving average (KAMA) values.
// https://www.alphavantage.co/documentation/#kama
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - time_period: Number of data points used to calculate each moving average value. Positive integers are accepted (e.g., <code>time_period=60</code>, <code>time_period=200</code>)
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetKama(symbol, interval, time_period, series_type, opt_datatype string) api.Response {
function := "KAMA"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"time_period": time_period,
"series_type": series_type,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// MAMA
// This API returns the MESA adaptive moving average (MAMA) values.
// https://www.alphavantage.co/documentation/#mama
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_fastlimit: Positive floats are accepted. By default, <code>fastlimit=0.01</code>.
// - opt_slowlimit: Positive floats are accepted. By default, <code>slowlimit=0.01</code>.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetMama(symbol, interval, series_type, opt_fastlimit, opt_slowlimit, opt_datatype string) api.Response {
function := "MAMA"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"series_type": series_type,
"fastlimit": opt_fastlimit,
"slowlimit": opt_slowlimit,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// VWAP
// This API returns the volume weighted average price (VWAP) for <u>intraday</u> time series. See also: <a href="https://www.investopedia.com/terms/v/vwap.asp" target="_blank">Investopedia article</a>.
// https://www.alphavantage.co/documentation/#vwap
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. In keeping with mainstream investment literatures on VWAP, the following intraday intervals are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetVwap(symbol, interval, opt_datatype string) api.Response {
function := "VWAP"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// T3
// This API returns the triple exponential moving average (T3) values. See also: <a href="http://www.fmlabs.com/reference/default.htm?url=T3.htm" target="_blank">mathematical reference</a>.
// https://www.alphavantage.co/documentation/#t3
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - time_period: Number of data points used to calculate each moving average value. Positive integers are accepted (e.g., <code>time_period=60</code>, <code>time_period=200</code>)
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetT3(symbol, interval, time_period, series_type, opt_datatype string) api.Response {
function := "T3"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"time_period": time_period,
"series_type": series_type,
"datatype": opt_datatype,
}
return a.client.Query(function, params)
}
// MACD
// This API returns the moving average convergence / divergence (MACD) values. See also: <a href="http://www.investopedia.com/articles/forex/05/macddiverge.asp" target="_blank">Investopedia article</a> and <a href="http://www.fmlabs.com/reference/default.htm?url=MACD.htm" target="_blank">mathematical reference</a>.
// https://www.alphavantage.co/documentation/#macd
//
// Parameters:
// - symbol: The name of the token of your choice. For example: <code>symbol=IBM</code>
// - interval: Time interval between two consecutive data points in the time series. The following values are supported: <code>1min</code>, <code>5min</code>, <code>15min</code>, <code>30min</code>, <code>60min</code>, <code>daily</code>, <code>weekly</code>, <code>monthly</code>
// - series_type: The desired price type in the time series. Four types are supported: <code>close</code>, <code>open</code>, <code>high</code>, <code>low</code>
// - opt_fastperiod: Positive integers are accepted. By default, <code>fastperiod=12</code>.
// - opt_slowperiod: Positive integers are accepted. By default, <code>slowperiod=26</code>.
// - opt_signalperiod: Positive integers are accepted. By default, <code>signalperiod=9</code>.
// - opt_datatype: By default, <code>datatype=json</code>. Strings <code>json</code> and <code>csv</code> are accepted with the following specifications: <code>json</code> returns the daily time series in JSON format; <code>csv</code> returns the time series as a CSV (comma separated value) file.
func (a *Alphavantage) GetMacd(symbol, interval, series_type, opt_fastperiod, opt_slowperiod, opt_signalperiod, opt_datatype string) api.Response {
function := "MACD"
params := map[string]string{
"symbol": symbol,
"interval": interval,
"series_type": series_type,
"fastperiod": opt_fastperiod,
"slowperiod": opt_slowperiod,
"signalperiod": opt_signalperiod,
"datatype": opt_datatype,
}
return a.client.Query(function, params)