Does anyone have a script to recover fees rates and 30 days trailing volume; thank you veru much.
You can use Get Transactions Summary
endpoint:
https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_gettransactionsummary
thank you very much, but i still without solution for this
this is my script but returns : Status Code: 401, Reason: Unauthorized
RĂ©ponse brute : Unauthorized
def create_signature(api_secret, timestamp, method, request_path, body=ââ):
message = timestamp + method + request_path + body
hmac_key = base64.b64decode(api_secret)
signature = hmac.new(hmac_key, message.encode(âutf-8â), hashlib.sha256)
signature_b64 = base64.b64encode(signature.digest()).decode()
return signature_b64
def get_transaction_summary(api_key, api_secret):
timestamp = str(int(time.time()))
method = âGETâ
request_path = â/api/v3/brokerage/transaction_summaryâ
body = ââ
signature = create_signature(api_secret, timestamp, method, request_path, body)
headers = {
'CB-ACCESS-SIGN': signature,
'CB-ACCESS-TIMESTAMP': timestamp,
'CB-ACCESS-KEY': api_key,
'CB-VERSION': '2023-11-08',
'Content-Type': 'application/json',
'User-Agent': 'My Coinbase App/1.0'
}
print("En-tĂȘtes de la requĂȘte:", headers)
print(f"Signature générée: {signature}")
conn = http.client.HTTPSConnection("api.coinbase.com")
conn.request(method, request_path, body, headers)
res = conn.getresponse()
data = res.read().decode("utf-8")
conn.close()
print(f"Status Code: {res.status}, Reason: {res.reason}")
print(f"RĂ©ponse brute : {data}")
API_KEY = os.getenv(âCOINBASE_API_KEYâ)
API_SECRET = os.getenv(âCOINBASE_API_SECRETâ)
if API_KEY and API_SECRET:
print(âExĂ©cution de get_transaction_summary avec les clĂ©s API fournies.â)
get_transaction_summary(API_KEY, API_SECRET)
else:
print(âLes clĂ©s dâAPI COINBASE nâont pas Ă©tĂ© trouvĂ©es. Veuillez les configurer comme variables dâenvironnement.â)
Any help is welcome, thanks in advance !
Please use Preformatted text
option for code!
Advanced trade secret is not base64
encoded and signature should not be encoded either.
Thank you !!! you are Great !!!
if any one want the script, i can share.