Korbit api with python http.client

0 votes

i've been trying to access following api: https://api.korbit.co.kr/v1/ticker/detailed

I am trying to do it using python

I used following code:

import http.client

conn = http.client.HTTPSConnection("https://api.korbit.co.kr", 443)
conn.request("GET", "/v1/ticker/detailed")
response = conn.getresponse()
data = response.read()


Traceback (most recent call last):
  File "C:/Users/K/PycharmProjects/nektie/test.py", line 4, in <module>
    conn.request("GET", "/v1/ticker/detailed")
  File "C:\Python34\lib\http\client.py", line 1090, in request
    self._send_request(method, url, body, headers)
  File "C:\Python34\lib\http\client.py", line 1128, in _send_request
  File "C:\Python34\lib\http\client.py", line 1086, in endheaders
  File "C:\Python34\lib\http\client.py", line 924, in _send_output
  File "C:\Python34\lib\http\client.py", line 859, in send
  File "C:\Python34\lib\http\client.py", line 1221, in connect
  File "C:\Python34\lib\http\client.py", line 836, in connect
    self.timeout, self.source_address)
  File "C:\Python34\lib\socket.py", line 491, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "C:\Python34\lib\socket.py", line 530, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed
Aug 28, 2018 in Blockchain by slayer
• 29,040 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

http.client.HTTPSConnection accepts hostname, not a url.

conn = http.client.HTTPSConnection("api.korbit.co.kr", 443)

BTW, I recommend to use library like python-requests:

import requests

r = requests.get('https://api.korbit.co.kr/v1/ticker/detailed')
data = r.json()
answered Aug 28, 2018 by digger
• 27,620 points

Related Questions In Blockchain

0 votes
1 answer

jQuery/ajax - two separate API requests with combined results

You can move the second ajax call ...READ MORE

answered Jun 19, 2018 in Blockchain by ariaholic
• 7,320 points
+1 vote
4 answers
0 votes
1 answer
0 votes
1 answer

Python request module for bitcoin json rpc

This should work: #!/usr/bin/env python import getpass import json import requests ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 27,620 points
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 27,620 points
0 votes
2 answers
0 votes
2 answers

Trying to issue tokens on testnet with python API

By looking at - documentation here I think you ...READ MORE

answered Sep 17, 2018 in Blockchain by Khush

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.