Quandl请求未提供实际数据

时间:2018-11-18 17:10:33

标签: c# api quandl

我目前正在使用HubertJ's QuandlCS C#-Wrapper向Quandl API发送请求以接收EUR-USD汇率,我的代码如下:

QuandlDownloadRequest request = new QuandlDownloadRequest();
request.Datacode = new Datacode("ECB", "EURUSD");
request.Format = FileFormats.JSON;
request.Frequency = Frequencies.Daily;
request.Truncation = 100;
request.Sort = SortOrders.Ascending;
request.Transformation = Transformations.None;
request.StartDate = DateTime.Now;
request.StartDate = request.StartDate.AddMinutes(-5);
request.EndDate = DateTime.Now;

IQuandlConnection connection = new QuandlConnection();
string data = connection.Request(request);

但是我只收到以下输出:

  

{“错误”:{},“ id”:14686248,“ source_name”:“欧洲中央银行”,“ source_code”:“ ECB”,“ code”:“ EURUSD”,“ name”:“ EUR vs美元外汇参考汇率”,“ urlize_name”:“ EUR-vs-USD-Foreign-Exchange-Reference-Rate”,“ display_url”:“ https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/eurofxref-graph-usd.en.html”,“ description”:“ Euro(EUR)vs.美元(USD)参考汇率。外汇参考汇率由欧洲中央银行发布,参考汇率通常在欧洲中部时间下午3:00之前更新,这是基于欧洲和世界各地各中央银行之间的常规每日协调程序。该程序通常在欧洲中部时间下午2:15进行。参考汇率是中端市场汇率,是根据买入和卖出汇率的平均值计算得出的;它们不一定反映实际交易汇率。欧元外汇参考汇率始终使用“某些方法(即EUR 1 = X外币单位,其中X是发布的参考汇率)。“,” updated_at“:” 2018-11-16T23:15:43.248Z“,” frequency“:” daily“,” from_date “:” 1999-0 1-04“,” to_date“:” 2018-11-16“,” column_names“:[” Date“,” Value“],” premium“:false,” data“:[],” type“:” Time系列”}

我在做什么错了?

1 个答案:

答案 0 :(得分:0)

发现API已更改。

API v1
API v3

https://www.quandl.com/api/v1/datasets/ECB/EURUSD.json?collapse=daily&transformation=none&sort_order=asc&rows=100&trim_start=2018-11-18&trim_end=2018-11-19
https://www.quandl.com/api/v3/datasets/ECB/EURUSD/data.json?collapse=daily&transform=none&order=asc&start_date=2018-11-18&end_date=2018-11-19

.json
/data.json

transformation
transform

sort_order
order

trim_start
start_date

trim_end
end_date

通过更改字段名称和一些修改,它可以工作。