各种基金调用介绍(haoservice介绍)
using System;
using System.Net;
using System.Text;
namespace all
{
class Program
{
static void Main(string[] args)
{
string key = "**************************";
string url = "http://apis.haoservice.com/lifeservice/netdata/all?key="+key;
WebClient wc = new WebClient();
wc.Encoding=Encoding.UTF8;
string str=wc.DownloadString(url);
Console.WriteLine(str);
Console.ReadKey();
}
}
}
各种不同基金调用只用把url换掉,申请key值即可
1.股票型基金
接口信息
URL: http://apis.haoservice.com/lifeservice/netdata/innov
支持格式:json
http请求方式:GET
参数说明:
名称 类型 必须 说明
key string 是 应用APPKEY(应用详细页查询)
返回结果:
{
"reason":"Success",
"error_code":0,
"result":[{
"1":{
"code":"165509", /*基金代码*/
"name":"信诚增强收益", /*基金简称*/
"newnet":"1.0240", /*最新净值*/
"totalreturn":"--", /*累计收益率*/
"totalnet":"--", /*累计净值*/
"weekgrowrate":"--", /*周增长率*/
"monthgrowrate":"--", /*月增长率%*/
"time":"20121218" /*最新净值时间*/
},
......
"19":{
"code":"150020",
"name":"富国汇利优先A",
"newnet":"1.0880",
"totalreturn":"--",
"totalnet":"--",
"weekgrowrate":"--",
"monthgrowrate":"--",
"time":"20121218"
}
......
}]
}
2.普通债券性基金
接口信息
URL: http://apis.haoservice.com/lifeservice/netdata/bond
支持格式:json
http请求方式:Get
参数说明:
名称 类型 必须 说明
key string 是 应用APPKEY(应用详细页查询)
返回结果:
{
"reason":"成功返回",
"error_code":0,
"result":[
{
"1":{
"code":"750003", /*基金代码*/
"name":"安信目标收益C", /*基金简称*/
"newnet":"--", /*最新净值*/
"totalnet":"--", /*累计净值*/
"dayincrease":"--", /*日增长值*/
"daygrowrate":"--", /*日增长率%*/
"weekgrowrate":"-200", /*周增长率%*/
"monthgrowrate":"-200", /*月增长率%*/
"time":" 2012年12月18日" /*最新净值时间*/
},
......
"209":{
"code":"070033",
"name":"嘉实增强收益定期",
"newnet":"--",
"totalnet":"--",
"dayincrease":"--",
"daygrowrate":"--",
"weekgrowrate":"-200",
"monthgrowrate":"-200",
"time":" 2012年12月18日"
}
......
}
]
}
3.货币型基金
接口信息
URL: http://apis.haoservice.com/lifeservice/netdata/monet
支持格式:json
http请求方式:GET
参数说明:
名称 类型 必须 说明
key string 是 应用APPKEY(应用详细页查询)
返回结果:
{
"reason":"成功返回",
"error_code":0,
"result":[
{
"1":{
"code":"730103", /*基金代码*/
"name":"方正富邦货币B", /*基金简称*/
"dayreturn":"", /*当日收益*/
"sevenratereturn":"", /*七天年化收益率*/
"yearincome":"--", /*本年累计收益*/
"annualyield":"--", /*累计收益年化收益率*/
"time":" 2012年12月18日" /*时间*/
},
......
"23":{
"code":"519999",
"name":"长信利息收益A",
"dayreturn":"",
"sevenratereturn":"",
"yearincome":"--",
"annualyield":"--",
"time":" 2012年12月18日"
}
......
}
]
}
4.封闭型基金
接口信息
URL: http://apis.haoservice.com/lifeservice/netdata/close
支持格式:json
http请求方式:GET
参数说明:
名称 类型 必须 说明
key string 是 应用APPKEY(应用详细页查询)
返回结果:
{
"error_code":"0",
"reason":"Success",
"result":[{
"1":{
"code":"184688", /*基金代码*/
"name":"基金开元", /*基金简称*/
"expdate":"20130327", /*到期日*/
"net":"0.8427", /*净值*/
"totalnet":"4.5237", /*累计值*/
"weekgrowrate":"2.8812", /*周增长率*/
"closepri":"0.7810", /*收盘价*/
"price":"--", /*涨跌%*/
"premiumvalue":"-0.0617", /*贴水值*/
"disrate":"-7.3217", /*折价率%*/
"time":" 2012年12月14日" /*时间*/
},
......
"6":{
"code":"184693",
"name":"基金普丰",
"expdate":"20140714",
"net":"0.8165",
"totalnet":"2.7375",
"weekgrowrate":"3.3675",
"closepri":"0.7300",
"price":"--",
"premiumvalue":"-0.0865",
"disrate":"-10.5940",
"time":" 2012年12月14日"
}
......
}]
}
5.创新封基
接口信息
URL: http://apis.haoservice.com/lifeservice/netdata/innov
支持格式:json
http请求方式:GET
参数说明:
名称 类型 必须 说明
key string 是 应用APPKEY(应用详细页查询)
返回结果:
{
"reason":"Success",
"error_code":0,
"result":[{
"1":{
"code":"165509", /*基金代码*/
"name":"信诚增强收益", /*基金简称*/
"newnet":"1.0240", /*最新净值*/
"totalreturn":"--", /*累计收益率*/
"totalnet":"--", /*累计净值*/
"weekgrowrate":"--", /*周增长率*/
"monthgrowrate":"--", /*月增长率%*/
"time":"20121218" /*最新净值时间*/
},
......
"19":{
"code":"150020",
"name":"富国汇利优先A",
"newnet":"1.0880",
"totalreturn":"--",
"totalnet":"--",
"weekgrowrate":"--",
"monthgrowrate":"--",
"time":"20121218"
}
......
}]
}
6.LOF
接口信息
URL: http://apis.haoservice.com/lifeservice/netdata/lof
支持格式:json
http请求方式:GET
参数说明:
名称 类型 必须 说明
key string 是 应用APPKEY(应用详细页查询)
返回结果:
{
"reason":"成功返回",
"error_code":0,
"result":[{
"1":{
"code":"166009", /*基金代码*/
"name":"中欧新动力", /*基金简称*/
"newnet":"--", /*最新净值*/
"totalreturn":"-200", /*累计收益率*/
"totalnet":"--", /*累计净值*/
"dayincrease":"--", /*日增长值*/
"daygrowrate":"--", /*日增长率%*/
"weekgrowrate":"-200", /*周增长率%*/
"monthgrowrate":"-200", /*月增长率%*/
"time":" 2012年12月18日" /*最新净值时间*/
},
......
"7":{
"code":"165508",
"name":"信诚深度价值",
"newnet":"--",
"totalreturn":"-200",
"totalnet":"--",
"dayincrease":"--",
"daygrowrate":"--",
"weekgrowrate":"-200",
"monthgrowrate":"-200",
"time":" 2012年12月18日"
}
......
}]
}
7.ETF
接口信息
URL: http://apis.haoservice.com/lifeservice/netdata/etf
支持格式:json
http请求方式:GET
参数说明:
名称 类型 必须 说明
key string 是 应用APPKEY(应用详细页查询)
返回结果:
{
"error_code":"0",
"reason":"Success",
"result":[{
"1":{
"code":"510903", /*基金代码*/
"name":"易方达恒生ETF", /*基金简称*/
"newnet":"1.0530", /*最新净值*/
"totalreturn":"5.3000", /*累计收益率*/
"totalnet":"1.0530", /*累计净值*/
"dayincrease":"-0.0002", /*日增长值*/
"daygrowrate":"-0.0190", /*日增长率%*/
"weekgrowrate":"2.5900", /*周增长率%*/
"monthgrowrate":"9.4700", /*月增长率%*/
"time":" 2012年12月18日" /*最新净值时间*/
},
......
"7":{
"code":"510333",
"name":"华夏沪深300ETF",
"newnet":"--",
"totalreturn":"-200",
"totalnet":"--",
"dayincrease":"--",
"daygrowrate":"--",
"weekgrowrate":"-200",
"monthgrowrate":"-200",
"time":" 2012年12月18日"
}
......
}]
}
8.QDII
接口信息
URL: http://apis.haoservice.com/lifeservice/netdata/qdii
支持格式:json
http请求方式:GET
参数说明:
名称 类型 必须 说明
key string 是 应用APPKEY(应用详细页查询)
返回结果:
{
"reason":"Success",
"error_code":0,
"result":[{
"1":{
"code":"539003", /*基金代码*/
"name":"建信全球资源", /*基金简称*/
"newnet":"1.0080", /*最新净值*/
"totalreturn":"0.8000", /*累计收益率*/
"totalnet":"1.0080", /*累计净值*/
"daygrowrate":"0.4985", /*日增长率%*/
"weekgrowrate":"--", /*周增长率%*/
"monthgrowrate":"--", /*月增长率%*/
"time":"20121217" /*最新净值时间*/
},
......
"7":{
"code":"519602",
"name":"海富通大中华",
"newnet":"0.8270",
"totalreturn":"-17.3000",
"totalnet":"0.8270",
"daygrowrate":"-0.1208",
"weekgrowrate":"0.1000",
"monthgrowrate":"-200",
"time":"20121217"
}
.....
}]
}
来源:https://www.cnblogs.com/wuiihui/p/4062862.html