#!/usr/bin/python
# -*- coding: utf-8 -*-
#用于访问OKCOIN 现货REST API
import time,datetime
import json
import urllib.request,urllib.parse
import hashlib,hmac
import numpy as np
class OKCoin:
def __init__(self, apikey, secretkey):
self.__url = "https://www.okcoin.cn/api/v1/"
self.__apikey = apikey
self.__secretkey = secretkey
# 获取OKCoin行情
def ticker(self, symbol = 'btc_cny'):
url = self.__url + 'ticker.do?symbol=%s'%(symbol)
return self.http_request(url)
# 获取OKCoin市场深度
def depth(self, symbol = 'btc_cny'):
url = self.__url + 'depth.do?symbol=%s'%(symbol)
return self.http_request(url)
# 获取OKCoin交易信息(600条)
def trades(self, symbol = 'btc_cny'):
url = self.__url + 'trades.do?symbol=%s'%(symbol)
return self.http_request(url)
# 获取OKCoin的K线数
OKCOIN交易所SDK-Python版
猜你喜欢
转载自blog.csdn.net/bitquant/article/details/105656539
今日推荐
周排行