Here is an article explaining how to program the history transactions from a certain period (
Obtaining Ethereum History Transactions from Bittrex API: A step -by -step guide
Introduction
————-
Bittrex is a popular exchange of cryptocurrency that allows users to buy, sell and trading various cryptocurrencies. One of the key characteristics of the Bittrex API is its ability to take over the historical market data, including transactions, for any given period. In
Premise
Before you start, make sure you have:
- A Bittrex account and are connected.
- Bittrex API credits (API, API Secret, etc.)
- A programming language of your choice (eg Python, Javascript)
Step 1: Install the necessary libraries
HTTP asks to make HTTP requests to Bittrex API. You can install it using PIP:
`Bash
Requests for installation PIP
Step 2: Authenticate with Bittrex
Key API and Secret in the requests or as an query parameter.
Python
Import Json
Replace with real API credentials
api_key = 'your_pi_key'
api_secret = 'your_pi_secret'
headers = {
"X-Apikey": Api_key,
"X-Apisecret": api_secret
}
query_params = {
"Square": "ETH",
Set the market to Ethereum (ETH)
"Limit": 100,
limit the number of transactions to be recovered
"Datetime": "Yyyy-Mm-Dthmmssutc"
Specify the beginning and end data/intervals
}
Step 3: Recover history transactions
Now that you are authenticated with Bittrex, you can use the "Requests" Library to make a request to the API. We will specify the query parameters that we have offered earlier.
Python
Import requests
Def get_history_trades (api_key, api_secret, market, limit, datetime_start, datetime_):
URL = ' + market + '/history'
params = {
"Limit": limit,
'Datetime_Start': Datetime_start,
'Datetime_nd': Datetime_end
}
Answer = Requests.Get (URL, headers = headers, params = params)
If answered.status_code == 200:
Data = reply.json ()
transactions = []
For data trade ["transactions"]:
Extract relevant fields from commercial object
Transaction_id = trade ['id']
Timestamp = trade ['timestamp']
Price = trade ['sum']
Amount = trade ['quantity']
transactions.apppend ({
'Transaction_id': transaction_id,
"Timestamp": Timestamp,
"Price": price,
"The amount": the amount
})
Return transactions
Otherwise:
Print (F'orror: {answer.status_code} ')
He doesn't return any
Example of use
api_key = 'your_pi_key'
api_secret = 'your_pi_secret'
market = 'eth'
limit = 100
Datetime_start = '2023-02-20T00: 00: 00z'
Datetime_nd = '2023-03-07T00: 00: 00z'
Transactions = get_history_trades (api_key, api_secret, market, limit, datetime_start, datetime_ind)
If the trades:
For trading with trades:
Printing (F'Trade ID: {Trade ["transaction_id"]} ')
Print (f'timestamp: {trade ["timestam"]} ')
Print (f'price: $ {trade ["price"]} ({trade ["sum"]} et ')
Print ('---------------')
Otherwise:
Print ("No historical transactions were found.")
`
troubleshoot
.
*
.