This repository was archived by the owner on May 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFind_Epics.py
More file actions
198 lines (180 loc) · 4.36 KB
/
Copy pathFind_Epics.py
File metadata and controls
198 lines (180 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
'''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY,
WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.'''
# Bitcoin Cash (BCH) qpz32c4lg7x7lnk9jg6qg7s4uavdce89myax5v5nuk
# Ether (ETH) - 0x843d3DEC2A4705BD4f45F674F641cE2D0022c9FB
# Litecoin (LTC) - Lfk5y4F7KZa9oRxpazETwjQnHszEPvqPvu
# Bitcoin (BTC) - 34L8qWiQyKr8k4TnHDacfjbaSqQASbBtTd
# contact :- github@jamessawyer.co.uk
#!/usr/bin/env python3
import requests
import simplejson as json
import time
url = 'https://api.ig.com/gateway/deal'
s = requests.Session()
s.headers = { 'Content-Type' : 'application/json; charset=UTF-8',
'Accept' : 'application/json; charset=UTF-8',
'VERSION' : '2',
'X-IG-API-KEY' : '*****************'
}
data = { 'identifier' : '*****************',
'password' : '*****************'
}
r = s.post(url + '/session', json=data)
s.headers.update({'X-SECURITY-TOKEN': r.headers['X-SECURITY-TOKEN'],
'CST': r.headers['CST'],
'VERSION' : '1'})
# r = s.get(url + '/markets?searchTerm=FTSE')
# # print(r.status_code)
# # print(r.reason)
# # print (r.text)
# for epic_id in r.json()['markets'] :
# print (epic_id['epic'])
def exploreNode(nodeID, liste) :
r = s.get(url + '/marketnavigation/' + nodeID)
# print(r.status_code)
# print(r.reason)
# print (r.text)
if isinstance( r.json()['nodes'], list ) :
for node in r.json()['nodes'] :
time.sleep(1)
exploreNode(node['id'], liste)
print(node['name'])
if isinstance( r.json()['markets'], list ) :
for market in r.json()['markets'] :
#print(market['epic'])
if "DFB" in str(market['epic']):
liste.append(market['epic'])
#print(market['epic'])
if "TODAY" in str(market['epic']):
liste.append(market['epic'])
#print(market['epic'])
if "DAILY" in str(market['epic']):
liste.append(market['epic'])
#print(market['epic'])
types = { 'LSE':'107565'}
# 93262
# Indices
# #################
# 165333
# Forex
# #################
# 93237
# Commodities Metals Energies
# #################
# 740446
# Cryptocurrency
# #################
# 94005
# Bonds and Moneymarket
# #################
# 150222
# ETFs, ETCs & Trackers
# #################
# 107565
# Shares - UK
# #################
# 100801
# Shares - UK International (IOB)
# #################
# 133682
# Shares - LSE (UK)
# #################
# 377740
# Shares - US (All Sessions)
# 105486
# Shares - US
# 93846
# Shares - Australia
# 93406
# Shares - Austria
# 93475
# Shares - Belgium
# 93395
# Shares - Canada
# 93398
# Shares - Denmark
# 93566
# Shares - Finland
# 93629
# Shares - France
# 93843
# Shares - Germany
# 93170
# Shares - Greece
# 93357
# Shares - Hong Kong
# 100380
# Shares - Ireland (ISEQ)
# 100307
# Shares - Ireland (LSE)
# 105809
# Shares - Netherlands
# 93411
# Shares - Norway
# 93563
# Shares - Portugal
# 93381
# Shares - Singapore
# 93360
# Shares - South Africa
# 93429
# Shares - Sweden
# 93401
# Shares - Switzerland
# 656351
# Digital 100s: 2 Hour FX
# 656381
# Digital 100s: 2 Hourlies
# 656390
# Digital 100s: 20 Min Markets
# 656120
# Digital 100s: 5 Min Markets
# 656118
# Digital 100s: FX
# 656416
# Digital 100s: Hourlies
# 656119
# Digital 100s: Indices
# 656407
# Digital 100s: Specials
# 656128
# Digital 100s:Commodities
# 110169
# Options (Australian, Cash)
# 302518
# Options (Eu Stocks 50)
# 157735
# Options (France 40)
# 125257
# Options (FTSE)
# 110184
# Options (Germany)
# 157943
# Options (Italy 40)
# 268825
# Options (Netherlands 25)
# 157738
# Options (Spain 35)
# 399997
# Options (Sweden 30)
# 346003
# Options (US 500)
# 125267
# Options (Wall St)
# 322274
# Options on FX Majors
# 166251
# Options on Metals, Energies
# 10891422
# Weekend Indices
liste = []
for t in types.keys() :
exploreNode( types[t], liste)
r = s.delete(url + '/session')
print(liste)