Skip to content

Instantly share code, notes, and snippets.

@kizbitz
Created March 10, 2018 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kizbitz/d888de2e5774ffea33b7df86c8766b76 to your computer and use it in GitHub Desktop.
Save kizbitz/d888de2e5774ffea33b7df86c8766b76 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import time
import json
request1 = requests.get('https://api.gdax.com/products/LTC-USD/candles?granularity=3600')
time.sleep(3)
request2 = requests.get('https://api.gdax.com/products/LTC-USD/candles?granularity=3600')
r1text = json.loads(request1.text)
r2text = json.loads(request2.text)
r1text.sort()
r2text.sort()
for i in range(len(r1text)):
# remove volume column
r1 = r1text[i][:-1]
r2 = r2text[i][:-1]
# compare results
if r1 != r2:
print('-' * 75)
print(r1)
print(r2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment