public List <Chart> GetHistoricData(string symbol, ChartOption chartOption) { string optionStr = chartOption.ToString().StartsWith("_") ? chartOption.ToString().Remove(0, 1) : chartOption.ToString(); string requestUrl = string.Format(this.GetIEXBaseRequestUri(IEXRequestType.Chart), symbol, optionStr); string jsonstring = base.GetString(requestUrl).Result; List <Chart> result = SerializerHandler.DeserializeObj <List <Chart> >(jsonstring); return(result); }
public BatchReport GetBatchReport(string symbol, IEnumerable <IEXDataType> types, ChartOption range, int itemCount) { string rangeStr = range.ToString().StartsWith("_") ? range.ToString().Remove(0, 1) : range.ToString(); string baseRequestUri = GetIEXBaseRequestUri(IEXRequestType.BatchReportForAStock); string requestUrl = string.Format(baseRequestUri, symbol, types.ToStringDelimeter(), rangeStr, itemCount.LimitToMax()); Console.WriteLine(requestUrl); string jsonstring = base.GetString(requestUrl).Result; return(SerializerHandler.DeserializeObj <BatchReport>(jsonstring)); }
public Dictionary <string, BatchReport> GetBatchReport(string[] symbols, IEnumerable <IEXDataType> types, ChartOption range, int itemCount, Period period = Period.Annual) { string rangeStr = range.ToString().StartsWith("_") ? range.ToString().Remove(0, 1) : range.ToString(); string baseRequestUri = GetIEXBaseRequestUri(IEXRequestType.BatchReportMarketForMultiStocks); string requestUrl = string.Format( baseRequestUri, symbols.ToStringDelimeter(), types.ToStringDelimeter(), rangeStr, itemCount.LimitToMax()); if (types.Contains(IEXDataType.financials)) { requestUrl = requestUrl + $"&period={period}"; } requestUrl = requestUrl.ToLower(); Console.WriteLine(requestUrl); string jsonstring = base.GetString(requestUrl.ToLower()).Result; return(SerializerHandler.DeserializeObj <Dictionary <string, BatchReport> >(jsonstring)); }