골드 데이터 쿼리 프레젠테이션 예



골드 데이터 쿼리 프레젠테이션 예
 
using System;
using System.Text;
using System.Net;
namespace gold
{
    class Program
    {
        static void Main(string[] args)
        {          
            string key = "*****************";//요청한 키 값
            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
지원 형식: json
http 요청 방법: GET POST
DEMO:http://apis.haoservice.com/lifeservice/gold/shgold?key=신청하신 APPKEY
예를 반환하려면 다음과 같이 하십시오.
{
"error_code":"0",
"reason":"Success!",
"result":[
{
"1":{
variety: Ag(T+D),/*품목*/
latestpri: 6585.00,/* 최신 가격 */
Openpri: "6712.00",/* 개장가 */
"maxpri": "6721.00",/*최고가*/
"minpri": "6581.00",/*최저가*/
"limit": "-1.98%",/* 상승폭*/
"yespri": "6718.00",/*어제 받은 가격*/
totalvol: 1564524.0000,/* 총 거래량*/
time: "2012-12-19 15:29:59"/* 업데이트 시간*/
},
...... 
"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":"2012-12-19 15:29:53"
}
......
}
]
}
참고:
황금 데이터 조회는 키값만 신청하면 된다.
오류가 발생하면 웹 페이지를 보십시오(http://www.haoservice.com/docs/22)의 코드 테이블입니다.
 

좋은 웹페이지 즐겨찾기