Crypto backtesting
Loading...
Searching...
No Matches
coins.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2
3# Get all currency pairs
4
5import json
6import requests
7from collections import deque
8
9f = open("exchanges.txt")
10exchange_names = deque(f.read().split())
11
12try:
13 url = "https://min-api.cryptocompare.com/data/all/exchanges"
14
15 r = requests.get(url)
16 exchanges = r.json()
17
18 for exchange in exchanges:
19 if exchange in exchange_names:
20 for from_symbol in exchanges[exchange]:
21 for to_symbol in exchanges[exchange][from_symbol]:
22 print(from_symbol, "\t", to_symbol, "\t", exchange)
23
24except Exception as e:
25 print("#", from_symbol, "generated exception: " + str(e))