teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

追加修正

2019/02/21 05:36

投稿

cloud_color
cloud_color

スコア7

title CHANGED
File without changes
body CHANGED
@@ -31,8 +31,21 @@
31
31
 
32
32
  ・なにを試したのか
33
33
  以下を参考にget_all_transactionsを実行しました
34
+ https://github.com/corpetty/py-etherscan-api/blob/master/examples/accounts/get_all_transactions.py
34
35
  ```python
35
- from etherscan.accounts import Account import json with open('../../api_key.json', mode='r') as key_file: key = json.loads(key_file.read())['key'] address = '0x49edf201c1e139282643d5e7c6fb0c7219ad1db7' api = Account(address=address, api_key=key) transactions = api.get_all_transactions(offset=10000, sort='asc', internal=False) print(transactions[0])
36
+ from etherscan.accounts import Account
37
+ import json
38
+
39
+ with open('../../api_key.json', mode='r') as key_file:
40
+ key = json.loads(key_file.read())['key']
41
+
42
+ address = '0x49edf201c1e139282643d5e7c6fb0c7219ad1db7'
43
+
44
+ api = Account(address=address, api_key=key)
45
+ transactions = api.get_all_transactions(offset=10000, sort='asc',
46
+ internal=False)
47
+
48
+ print(transactions[0])
36
49
  ```
37
50
  ・なにが問題なのか
38
51
  不明

2

質問への追記・修正の依頼反映

2019/02/21 05:36

投稿

cloud_color
cloud_color

スコア7

title CHANGED
File without changes
body CHANGED
@@ -1,3 +1,4 @@
1
+ ・なにがしたいのか
1
2
  以下を実行するとAPIから情報を取得できるのですが、
2
3
  page_no=1だけでなく一括でAPI上の全件データを取得する方法はあるのでしょうか?
3
4
  ```python
@@ -26,4 +27,15 @@
26
27
  ret = get_tx_value(page_no=1, address=ADDRESS,api_key=API_KEY)
27
28
  df = pd.DataFrame(ret,columns=['hash','from','to','value','datetime'])
28
29
  df.to_csv('txes.tsv',sep='\t')
29
- ```
30
+ ```
31
+
32
+ ・なにを試したのか
33
+ 以下を参考にget_all_transactionsを実行しました
34
+ ```python
35
+ from etherscan.accounts import Account import json with open('../../api_key.json', mode='r') as key_file: key = json.loads(key_file.read())['key'] address = '0x49edf201c1e139282643d5e7c6fb0c7219ad1db7' api = Account(address=address, api_key=key) transactions = api.get_all_transactions(offset=10000, sort='asc', internal=False) print(transactions[0])
36
+ ```
37
+ ・なにが問題なのか
38
+ 不明
39
+
40
+ ・なんのエラーが出ているのか
41
+ ****MacBook-Pro:accounts home$ python get_all_transactions.py page 1 added Traceback (most recent call last): File "get_all_transactions.py", line 11, in <module> internal=False) File "/anaconda3/lib/python3.6/site-packages/py_etherscan_api-0.8.0-py3.6.egg/etherscan/accounts.py", line 92, in get_all_transactions File "/anaconda3/lib/python3.6/site-packages/py_etherscan_api-0.8.0-py3.6.egg/etherscan/client.py", line 123, in connect etherscan.client.EmptyResponse: <Err: No transactions found>

1

質問への追記・修正の依頼対応

2019/02/21 05:35

投稿

cloud_color
cloud_color

スコア7

title CHANGED
File without changes
body CHANGED
File without changes