Demo of gold Data Query
Using system;
Using system. text;
Using system. net;
Namespace gold
{
Class Program
{
Static void main (string [] ARGs)
{
String key = "******************"; // applied key value
String url = "http://apis.haoservice.com/lifeservice/gold/shgold? Key = "+ key;
WebClient WC = new WebClient ();
WC. Encoding = encoding. utf8;
String STR = WC. downloadstring (URL );
Console. writeline (STR );
Console. readkey ();
}
}
}
URL: http://apis.haoservice.com/lifeservice/gold/shgold
Supported format: JSON
HTTP Request Method: Get post
Demo: http://apis.haoservice.com/lifeservice/gold/shgold? Key = The appkey you applied
Return example:
{
"Error_code": "0 ",
"Reason": "success! ",
"Result ":[
{
"1 ":{
"Variety": "AG (t + D)",/* variety */
"Latestpri": "6585.00",/* latest price */
"Openpri": "6712.00",/* start */
"Maxpri": "6721.00",/* maximum price */
"Minpri": "6581.00",/* minimum price */
"Limit": "-1.98%",/* increase/decrease */
"Yespri": "6718.00",/* Renewal */
"Totalvol": "1564524.0000",/* Total transaction volume */
"Time": "15:29:59"/* Update time */
},
......
"7 ":{
"Variety": "au99.99 ",
"Latestpri": "336.77 ",
"Openpri": "342.00 ",
"Maxpri": "342.00 ",
"Minpri": "336.40 ",
"Limit": "-1.53% ",
"Yespri": "342.00 ",
"Totalvol": "6936.2000 ",
"Time": "15:29:53"
}
......
}
]
}
Note:
For gold data query, you only need to apply for the key value;
If an error occurs, view the code table on this web page (http://www.haoservice.com/docs/22.
Gold Data Query