2016-03-02 153 views
0

我只是想知道這個代碼是否是雅虎財務的正確API,因爲它不起作用。如果有人有正確的API,我很樂意聽到回覆。雅虎財務API錯誤

這是代碼。

let urlString:String = ("https://query.yahooapis.com/v1/public/yql?q=select * 
from yahoo.finance.quotes where symbol IN 
"+stringQuotes+"&format=json&env=http://datatables.org/alltables.env").stringByAdd 
ingPercentEscapesUsingEncoding(NSUTF8StringEncoding)! 

回答

1

有此刻與http://datatables.org/ 的問題似乎該網站沒有響應,這使得所有的YQL查詢社區數據表無法正常工作。

似乎已經關閉了大約12個小時。我希望他們不要將其關閉:(

您的網址是缺少括號surronding stringQuotes(只是想萬一提你的字符串變量「stringQuotes」沒有它)

let urlString:String = ("https://query.yahooapis.com/v1/public/yql?q=select * 
from yahoo.finance.quotes where symbol IN 
("+stringQuotes+")&format=json&env=http://datatables.org/alltables.env").stringByAdd 
ingPercentEscapesUsingEncoding(NSUTF8StringEncoding)! 
+0

比其他,如果這個代碼仍然有效@Dilberted –

+0

yup。沒關係,沒有問題。 – Dilberted