vslee / iexsharp Goto Github PK
View Code? Open in Web Editor NEWIEX Cloud API for C# and other .net languages. Supports SSE streaming
License: MIT License
IEX Cloud API for C# and other .net languages. Supports SSE streaming
License: MIT License
/stock/market/list/{list-type}
Please give support all Query String Parameters for this api.
Link: https://iexcloud.io/docs/api/#list
Hi,
I'm using the Batch api to get a list of stock prices from the IntradayPrices endpoint. Some of the stocks returns "null" for fields such as volume from IEX, this in turn causes the Json Deserializer to throw an exception internally.
this is how I'm making the call
try { return await _batchService.BatchByMarketAsync(symbols, new[] { BatchType.IntradayPrices }, _fiveMinutesChartLatestPointArguments); } catch (JsonException exception) { Console.WriteLine(exception); }
an example symbol that fails is "AMER" which IEX cloud returns the following response,
"AMER": {
"intraday-prices": [
{
"date": "2020-11-20",
"minute": "15:55",
"label": null,
"high": null,
"low": null,
"average": null,
"volume": null,
"notional": null,
"numberOfTrades": null,
"marketHigh": null,
"marketLow": null,
"marketAverage": null,
"marketVolume": null,
"marketNotional": null,
"marketNumberOfTrades": null,
"open": null,
"close": null,
"marketOpen": null,
"marketClose": null,
"changeOverTime": null,
"marketChangeOverTime": null
}
]
}
Here is the stack trace,
---> System.Text.Json.JsonException: The JSON value could not be converted to System.Int64. Path: $.AMER.intraday-prices[0].volume | LineNumber: 0 | BytePositionInLine: 32105.
---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
at System.Text.Json.Utf8JsonReader.TryGetInt64(Int64& value)
at System.Text.Json.Utf8JsonReader.GetInt64()
at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack& state, Utf8JsonReader& reader)
at System.Text.Json.JsonSerializer.HandleNull(Utf8JsonReader& reader, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, Utf8JsonReader& reader, Exception ex)
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken)
--- End of inner exception stack trace ---
at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken)
at IEXSharp.Service.Cloud.CoreData.Batch.BatchService.BatchByMarketAsync(IEnumerable`1 symbols, IEnumerable`1 types, IReadOnlyDictionary`2 optionalParameters)
Hi, I'm trying to create a batch request and in fiddler I see that the values come in via the API, but when trying to get the values through response.Data (BatchResponse) all of the properties are null
When importing PFF data with the DividendsAdvancedAsync function, an error occurs saying that NULL cannot be parsed as INT.
Hi,
There is an issue with parsing string numbers after updating from 2.3.0. to 2.4.8. using Crypto.QuoteStream:
[{"symbol":"BTCUSDT","primaryExchange":"","sector":"cryptocurrency","calculationPrice":"realtime","latestPrice":"19194.67000000","latestSource":"Real time price","latestUpdate":1607359072095,"latestVolume":null,"bidPrice":"19194.66000000","bidSize":"2.30286700","askPrice":"19194.67000000","askSize":"0.26471800","high":null,"low":null,"previousClose":null}] The JSON value could not be converted to System.Decimal. Path: $[0].latestPrice | LineNumber: 0 | BytePositionInLine: 128. Cannot get the value of a token type 'String' as a number.
latestPrice in this format should be parsed fine, but doesn't for some reason.
Call stack:
System.Text.Json.JsonException:
at IEXSharp.Helper.SSEClient`1.Evt_MessageReceived (IEXSharp, Version=2.4.8.0, Culture=neutral, PublicKeyToken=null)
at LaunchDarkly.EventSource.EventSource.OnMessageReceived (LaunchDarkly.EventSource, Version=3.3.2.0, Culture=neutral, PublicKeyToken=18e8c36453e3060f)
at LaunchDarkly.EventSource.EventSource.DispatchEvent (LaunchDarkly.EventSource, Version=3.3.2.0, Culture=neutral, PublicKeyToken=18e8c36453e3060f)
at LaunchDarkly.EventSource.EventSource.ProcessResponseContent (LaunchDarkly.EventSource, Version=3.3.2.0, Culture=neutral, PublicKeyToken=18e8c36453e3060f)
at LaunchDarkly.EventSource.EventSourceService+<ProcessResponseFromReaderAsync>d__15.MoveNext (LaunchDarkly.EventSource, Version=3.3.2.0, Culture=neutral, PublicKeyToken=18e8c36453e3060f)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at LaunchDarkly.EventSource.EventSourceService+<ConnectToEventSourceApi>d__13.MoveNext (LaunchDarkly.EventSource, Version=3.3.2.0, Culture=neutral, PublicKeyToken=18e8c36453e3060f)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at LaunchDarkly.EventSource.EventSourceService+<GetDataAsync>d__12.MoveNext (LaunchDarkly.EventSource, Version=3.3.2.0, Culture=neutral, PublicKeyToken=18e8c36453e3060f)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at LaunchDarkly.EventSource.EventSource+<ConnectToEventSourceAsync>d__42.MoveNext (LaunchDarkly.EventSource, Version=3.3.2.0, Culture=neutral, PublicKeyToken=18e8c36453e3060f)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
Inner exception System.Text.Json.JsonException handled at IEXSharp.Helper.SSEClient`1.Evt_MessageReceived:
at System.Text.Json.ThrowHelper.ReThrowWithPath (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.JsonSerializer.ReadCore (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.JsonSerializer.ReadCore (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.JsonSerializer.Deserialize (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.JsonSerializer.Deserialize (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at IEXSharp.Helper.SSEClient`1.Evt_MessageReceived (IEXSharp, Version=2.4.8.0, Culture=neutral, PublicKeyToken=null)
Inner exception System.InvalidOperationException handled at System.Text.Json.ThrowHelper.ReThrowWithPath:
at System.Text.Json.Utf8JsonReader.TryGetDecimal (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.Utf8JsonReader.GetDecimal (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.Serialization.Converters.JsonConverterDecimal.Read (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.JsonPropertyInfo.Read (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
at System.Text.Json.JsonSerializer.ReadCore (System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
Possibly broken by #71 ?
Hey VsLee,
i am still getting the error with the system.decimal conversion :/.
i updated to 2.4.7 but the real time price still seems to be not nullable in the metadata for me.
i also reinstalled the package already. I love this library and i would like to keep using it :/.
Do you have an idea what could be the problem?
i attached two screenshot.
Thanks in advance & best regards
Tobias
I tried this:
string ticker = "appl"// for example
IEXCloudClient client = new new IEXCloudClient(.....);
var stock = await client.StockFundamentals.AdvancedFundamentalsAsync(ticker);
why stock is null?
Hey buddies,
is there a way to get streaming news for just one language?
I just want english news and getting news in every language is pretty expensive..
Thanks!
Hi
Are there any plans to support the advanced dividends endpoint?
Hello,
Fantastic package, thanks a ton for your hard work.
In IEXSharp/IEXSharp/Helper/ExecutorREST.cs, there is currently only one backoff policy supported - ExponentialBackoffPolicy. It would be great if the policy was customizable or had a few options to set via either the initial constructor to IEXCloudClient, some method within IEXCloudClient, or elsewhere, particularly for nuget users.
Ideally, there would be a linear policy to choose from (or, at the very least an exponential one that is not multiplied by a factor of a quarter of a second).
A configurable number of retries before failing would be ideal too.
The end idea here is to be able to "quickly" send many requests at once and handle the timing and error cases (via IEXResponse.ErrorMessage) on the user side if desired. The REST API should be able to support this (somewhat) as IEXCloud states in the documentation to wait a minimum of 10ms between requests.
Thanks,
Cart-Cart
Hi,
I couldn't find this api in here under Reference Data section.
GET /search/{fragment}
https://iexcloud.io/docs/api/#search
Hey Guys,
could you please check the return values from Crypto.BookAsync method. The values I get from this method seems to be wrong if I compare it to the REST call in browser. Maybe I do something wrong...
IEXCloudClient iexCloudClient_Crypto = new IEXCloudClient("pk_****", "secretToken", signRequest: false, useSandBox: false);
string[] iexSymbols = {"BTCUSD", "ETHUSD"};
foreach (var symbol in iexSymbols)
{
log.LogInformation(symbol);
//local list of orders from IEX
var response = await iexCloudClient_Crypto.Crypto.BookAsync(symbol);
}
The Value for BTCUSD Price I get is eg. 3725466 I thing it should be 37254.66 ?
Is this by purpose?
Thank you and best regards,
Anton
[{"symbol":"PALL","companyName":"Aberdeen Standard Physical Palladium Shares ETf","primaryExchange":"NYSE Arca","calculationPrice":"sip","open":219.74,"openTime":1606314600195,"openSource":"official","close":221.26,"closeTime":1606251600070,"closeSource":"official","high":220.5,"highTime":1606335998843,"highSource":"15 minute delayed price","low":219.2,"lowTime":1606316605077,"lowSource":"15 minute delayed price","latestPrice":220.1,"latestSource":"15 minute delayed price","latestTime":"3:23:24 PM","latestUpdate":1606335804130,"latestVolume":9632,"iexRealtimePrice":0,"iexRealtimeSize":0,"iexLastUpdated":0,"delayedPrice":220.1,"delayedPriceTime":1606335804130,"oddLotDelayedPrice":220.1,"oddLotDelayedPriceTime":1606335998843,"extendedPrice":219.5,"extendedChange":-0.6,"extendedChangePercent":-0.00273,"extendedPriceTime":1606314600806,"previousClose":221.26,"previousVolume":26308,"change":-1.16,"changePercent":-0.00524,"volume":9632,"iexMarketPercent":null,"iexVolume":0,"avgTotalVolume":27875,"iexBidPrice":0,"iexBidSize":0,"iexAskPrice":220.51,"iexAskSize":500,"iexOpen":null,"iexOpenTime":null,"iexClose":219.94,"iexCloseTime":1606236000040,"marketCap":374170000,"peRatio":null,"week52High":273.16,"week52Low":137.51,"ytdChange":0.194586,"lastTradeTime":1606335804130}] The JSON value could not be converted to System.Decimal. Path: $[0].iexMarketPercent | LineNumber: 0 | BytePositionInLine: 967.
Looks like IEX changed something on their API again making the KeyStat deserialzier fail on null DateTime values
System.Text.Json.JsonException: {"companyName":"Tesla Inc","marketcap":1021367482430,"week52high":1243.49,"week52low":539.49,"week52highSplitAdjustOnly":1243.49,"week52lowSplitAdjustOnly":539.49,"week52change":0.6672896276988147,"sharesOutstanding":1004264852,"float":0,"avg10Volume":19917128,"avg30Volume":24369071,"day200MovingAvg":802.42,"day50MovingAvg":1092.68,"employees":70757,"ttmEPS":3.03,"ttmDividendRate":0,"dividendYield":0,"nextDividendDate":"","exDividendDate":"","nextEarningsDate":"2022-01-26","peRatio":294.5119614848789,"beta":1.8002951554377649,"maxChangePercent":211.8568438677271,"year5ChangePercent":25.425973081120407,"year2ChangePercent":13.137983763345192,"year1ChangePercent":0.6672896276988147,"ytdChangePercent":0.4412260688423768,"month6ChangePercent":0.667563003164505,"month3ChangePercent":0.3813275021391609,"month1ChangePercent":-0.015859960132376116,"day30ChangePercent":-0.015859960132376116,"day5ChangePercent":0.0020296166389153214} ---> System.Text.Json.JsonException: The JSON value could not be converted to System.Nullable
1[System.DateTime]. Path: $.nextDividendDate | LineNumber: 0 | BytePositionInLine: 425.
---> System.FormatException: The JSON value is not in a supported DateTime format.
at System.Text.Json.Utf8JsonReader.GetDateTime()
at System.Text.Json.Serialization.Converters.DateTimeConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
at System.Text.Json.Serialization.Converters.NullableConverter1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter
1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, Type returnType, JsonSerializerOptions options) at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken) --- End of inner exception stack trace --- at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken) at IEXSharp.Helper.ExecutorREST.SymbolExecuteAsync[ReturnType](String urlPattern, String symbol) at IEXSharp.Service.Cloud.CoreData.StockResearch.StockResearchService.KeyStatsAsync(String symbol)
Calling StockProfiles.InsiderTransactionsAsync for AAPL throws a JSON int64 out of bounds error.
IEX response:
...
"updated":1709268016103.4824
...
System.Text.Json: The JSON value could not be converted to System.Int64.
Either the JSON value is not in a supported format, or is out of bounds for an Int64.
PR #119 and #120 address exactly the same issue, by changing the 'updated' property from a long to a decimal.
IEXCloud provides no documentation on the 'updated' property.
Hello,
It appears that when I try to make a call to get the price for any of the cryptocurrencies the json serialization fails:
Example:
var response = iexCloudClient.Crypto.PriceAsync("ETHUSD").Result;
returns :
JsonException: The JSON value could not be converted to System.Decimal. Path: $.price | LineNumber: 0 | BytePositionInLine: 18.
Do you have any fix on that?
InsiderTransactionResponse defines fields TransactionShares, TranShares and PostShares as a nullable long.
Example response from IEX for symbol DIS.
TransactionShares: 595.2000122070312
Results in the following exception:
System.Text.Json: The JSON value could not be converted to System.Nullable`1[System.Int64]. Path: $[0].transactionShares | LineNumber: 0 | BytePositionInLine: 321. System.Text.Json.Rethrowable: Either the JSON value is not in a supported format, or is out of bounds for an Int64.
IEX docs define it as type 'number', so it should probably be changed to a nullable decimal.
Hello,
I am using the StockPrices api to get the quote of a symbol. However it fails with the JsonSerializer exception "Serializer options cannot be changed once serialization or deserialization has occurred."
System.InvalidOperationException: Serializer options cannot be changed once serialization or deserialization has occurred.
at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_SerializerOptionsImmutable()
at System.Text.Json.Serialization.ConverterList.Add(JsonConverter item)
at IEXSharp.Helper.ExecutorBase.get_JsonSerializerOptions()
at IEXSharp.Helper.ExecutorREST.ExecuteAsync[ReturnType](String urlPattern, NameValueCollection pathNVC, QueryStringBuilder qsb, Boolean forceUseSecretToken)
at IEXSharp.Helper.ExecutorREST.SymbolExecuteAsync[ReturnType](String urlPattern, String symbol)
at IEXSharp.Service.Cloud.CoreData.StockPrices.StockPricesService.QuoteAsync(String symbol)
From looking at the docs it looks like this happens when the JsonSerializerOptions is modified after use.
Hey All,
love this package! Please could you add DEER Book calls for US Stocks and Crypto which is mentioned here in the API description:
curl --header 'Accept: text/event-stream' https://cloud-sse.iexapis.com/stable/deep?token=YOUR_TOKEN&symbols=twtr&channels=book
curl --header 'Accept: text/event-stream' https://cloud-sse.iexapis.com/stable/cryptoBook\?symbols\=btcusd\&token\=YOUR_TOKEN
This would be awesome!
Thank you
Hello:
This might be similar to the other 'open' issue. When executing the following query, receive error message:
var response = await iexCloudClient.StockPrices.HistoricalPriceAsync("WWR", ChartRange.TwoYears);
Error:
Inner Exception: {"The JSON value could not be converted to System.Nullable`1[System.Int64]. Path: $[0].volume | LineNumber: 0 | BytePositionInLine: 88."}
Message: Either the JSON value is not in a supported format, or is out of bounds for an Int64.
Message: [{"close":9.5,"high":9.5,"low":7.575,"open":9,"symbol":"WWR","volume":30076.100000000006,"id":"HISTORICAL_PRICES","key":"WWR","subkey":"","date":"2019-04-22","updated":1606830572000,"changeOverTime":0,"marketChangeOverTime":0,"uOpen":0.18,"uClose":0.19,"uHigh":0.19,"uLow":0.1515,"uVolume":1503805,"fOpen":9,"fClose":9.5,"fHigh":9.5,"fLow":7.575,"fVolume":30076.100000000006,"label":"Apr 22, 19","change":0,"changePercent":0}, ........
Thanks.
If you execute the DividendBasicAsync tests while using production IEX credentials and production server, the test will fail. The date property on DividendResponse is actually a Unix Epoch Long.
I had to change date property from DateTime to a long for my application to work properly.
using System;
using IEXSharp.Model.Shared.Response;
namespace IEXSharp.Model.CoreData.StockFundamentals.Response
{
public class DividendBasicResponse : Dividend
{
public DateTime date { get; set; }
}
}
#62 I updated the model and tested that it now works with MVIS as of right now.
I can't see anything in the documentation from IEX that would give indication as to which of these fields we should expect to be nullable.
Hi,
Do you have any immediate plans to add support for technical indicators (https://iexcloud.io/docs/api/#technical-indicators)?
Cheers!
Would be great to add peers to the batch type.
Its a separate call in the lib now however API supports peers in a batch call.
var response = await iexCloudClient.StockPrices.HistoricalPriceAsync("IBM", ChartRange.FiveDayMinute);
12/21/2020 3:20:00 PM Open: 123.24, High: 123.45, Low: 123.235, Close: 123.45, Vol: 2687
12/21/2020 3:30:00 PM Open: 123.425, High: 123.47, Low: 123.12, Close: 123.34, Vol: 6532
12/21/2020 3:40:00 PM Open: 123.43, High: 123.43, Low: 123.13, Close: 123.21, Vol: 5257
12/21/2020 3:50:00 PM Open: 123.2, High: 123.54, Low: 122.985, Close: 123.38, Vol: 20583
Is this an artifact of my free key from them or another issue in the library? I am really looking for 15 minute intervals. I looked through the tests and didn't see anything that stood out to specify bar duration.
Seems to work fine in .Net 5 other than that.
Hi,
When I execute below code, I get an error like this (sure enough my Tokens are in there):
Child “token” fails beause [“token” must be a string
using (var iexCloudClient = new IEXCloudClient("pk_", "sk_", signRequest: true, useSandBox: false))
{
var response = await iexCloudClient.Stock.KeyStatsStatAsync("AAPL", "marketCap");
if (response.ErrorMessage != null)
{
Console.WriteLine(response.ErrorMessage);
}
else
{
Console.WriteLine(response.Data.marketcap);
}
}
Any ideas what could be the issue?
Historical volume can be split adjusted and therefore a fractional number (volume:1107729848.505649) that won't parse nicely into an Int64.
var response = await iexCloudClient.StockPrices.HistoricalPriceAsync("AAPL", ChartRange.Max);
{"The JSON value could not be converted to System.Nullable`1[System.Int64]. Path: $[0].volume | LineNumber: 0 | BytePositionInLine: 96."}
JSON:"[{"close":3.09,"high":3.15,"low":3.0268,"open":3.0962,"symbol":"AAPL","volume":1107729848.505649,"id":"ISIOLIARC_PHTRSCE","key":"LAPA","subkey":"0","date":"2006-12-29","updated":1629558309192,"changeOverTime":0,"marketChangeOverTime":0,"uOpen":84.801,"uClose":85.73,"uHigh":86.9,"uLow":85.85,"uVolume":38840383,"fOpen":2.6401,"fClose":2.6215,"fHigh":2.6485,"fLow":2.647,"fVolume":1112153566.051404,"label":"Dec 29, 06","change":0,"changePercent":0}]"
Using IEXSharp 2.6.0 via NuGet package.
I can use the ChartRange.DateType (as below), but I can't figure out how to input the desired date that I want to extract the minute-price history with. I know there is HistoricalPricesByDate, but this only provides the daily open/close, etc.. Do you know how I can specify the date, or a better way to extract minute based historical data. IEXcloud states on their page they make the previous 30 days minute-level data available for access.
-Great API! Love it's features and ease of use!
-Thank you
Hello all. When pulling dividend information I get the following error:
The JSON value could not be converted to System.Int64
Here's the data I receive:
[{"amount":1.9,"currency":"USD","declaredDate":"2022-02-22","description":"Ordinary Shares","exDate":"2022-03-09","flag":"Cash","frequency":"quarterly","paymentDate":"2022-03-24","recordDate":"2022-03-10","refid":2452707,"symbol":"HD","id":"DIVIDENDS","key":"HD","subkey":"2452707","date":1646784000000,"updated":1647302657303.492}]
Hi,
I am getting started with IEXSharp and IEXCloud. At the moment, im mostly testing the functionalities of your client, which seem to be quite nice!
There is 3 endpoints that doesn't seem to be existing in your current client
Is there any plan to integrate these endpoints (and maybe also GET /stock/{symbol}/earnings/{last}/{field}) ?
Thank you
ps: good job for your client, pretty amazing and well done!
System has been running fine without issue for over a year. Running under version 2.8.0.
Attempting to retrieve quote for AMD via the following:
var response = await iexCloudClient.StockPrices.HistoricalPriceAsync(symbol, ChartRange.ThreeMonths);
Results in:
{"The JSON value could not be converted to System.Nullable`1[System.Int64]. Path: $[0].updated | LineNumber: 0 | BytePositionInLine: 184."}
Inner Exception:
Either the JSON value is not in a supported format, or is out of bounds for an Int64.
Data results have been attached. What am I missing? Seems any value expecting int64 could be set to 0 but not following how can't be set to System.Nullable. Any pointers appreciated.
IEXDataError.txt
While generally it shouldn't be too hard to use the QueryStringBuilder, it'd be great if either in the tests or in the wiki (or both?) there would be some examples for how to use the QueryStringBuilder, e.g. for the qsb
parameter in IStockPricesService.HistoricalPriceAsync()
.
Perhaps such examples already exist. Then perhaps adding a link in the README.md or in the wiki (or both?) would be helpful.
Thank you and keep up the good work!
Retrieving the company info appears to have an invalid JSON object which you are trying to decode too.
Amazon being retrieved by this triggers the error.
{"symbol":"AMZN","companyName":"Amazon.com Inc.","exchange":"NASDAQ/NGS (GLOBAL SELECT MARKET)","industry":"Electronic Shopping and Mail-Order Houses ","website":"http://www.amazon.com/","description":"","CEO":"Jeffrey Bezos","securityName":"Amazon.com Inc.","issueType":"cs","sector":"Retail Trade","primarySicCode":5961,"employees":null,"tags":["Retail Trade","Internet Retail"],"address":"410 Terry Ave N","address2":null,"state":"Washington","city":"Seattle","zip":"98109-5210","country":"US","phone":"12062661000"}
The JSON value could not be converted to System.Int32. Path: $.employees | LineNumber: 0 | BytePositionInLine: 338. THe employees needs to be an Integer? not integer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.