雅虎融资webservice API直接到?bypass = true

时间:2017-03-14 02:01:46

标签: web-services yahoo-api yahoo-finance

请参阅Yahoo finance webservice API,我找不到http://finance.yahoo.com/webservice/v1/symbols/YHOO,AAPL/quote?format=json&view=detail

它显示'不是有效参数'。 我也发现它会指向?bypass = true 如何查看json数据?

1 个答案:

答案 0 :(得分:0)

我的理解是json只能通过Yahoo Query Language(yql)API支持。 API端点为q=select * from yahoo.finance.quotes where symbol in ('symbol1,symbol2'),您必须在表单中提交查询(前缀为?)format=json,您还必须将格式指定为env=store://datatables.org/alltableswithkeys,您可能还需要指定一个环境,以便根据特定模式正确返回数据。到目前为止,我发现curl -G http://query.yahooapis.com/v1/public/yql? --data-urlencode "q=select * from yahoo.finance.quotes where symbol in ('symbol1, symbol2') --data-urlencode "format=json" --data-urlencode "env=store://datatables.org/alltableswithkeys" 对我有用。当然,整个网址必须是网址编码的,您可以运行curl命令对其进行测试(替换为实际的股票代码):

// Point
  Route::get('admincp/point', 'PointController@index');
  Route::post('admincp/point/store', 'PointController@store');
  Route::get('admincp/point/{id}/edit', 'PointController@edit');
  Route::patch('admincp/point/{id}/update', 'PointController@update');
  Route::get('admincp/point/{id}/destroy', 'PointController@destroy');

// Faq
  Route::get('admincp/faq', 'FaqController@index');
  Route::post('admincp/faq/store', 'FaqController@store');
  Route::get('admincp/faq/{id}/edit', 'FaqController@edit');
  Route::patch('admincp/faq/{id}/update', 'FaqController@update');
  Route::get('admincp/faq/{id}/destroy', 'FaqController@destroy');

// Slider
  Route::get('admincp/slider', 'SliderController@index');
  Route::post('admincp/slider/store', 'SliderController@store');
  Route::get('admincp/slider/{id}/edit', 'SliderController@edit');
  Route::patch('admincp/slider/{id}/update', 'SliderController@update');
  Route::get('admincp/slider/{id}/destroy', 'SliderController@destroy');

有关详情,请查看YQL Guide。它花了我几个小时的阅读和尝试和错误才能使它工作!