List Accounts limit query parameter issue

Hi I am having an issue adding a limit query parameter to my request of List Accounts.
Here is my code.
Any ideas would be hugely welcomed.

def acc_bal(cur):
timestamp = str(int(time.time()))
method = "GET"
request_path = f'/api/v3/brokerage/accounts/?limit=250'  # Added the limit parameter
body = ''
message = str(timestamp) + method + request_path + body
signature = hmac.new(secret_key.encode('utf-8'), message.encode('utf-8'), hashlib.sha256).hexdigest()

headers = {
    'accept': 'application/json',
    'CB-ACCESS-KEY': api_key,
    'CB-ACCESS-TIMESTAMP': timestamp,
    'CB-ACCESS-SIGN': signature,
    'Content-Type': 'application/json'
}

conn = http.client.HTTPSConnection("api.coinbase.com")
payload = ''

conn.request("GET", request_path, payload, headers)
res = conn.getresponse()

if res.status == 200:
    data = res.read().decode('utf-8')
    acc_data = json.loads(data)
    
    for account in acc_data['accounts']:
        if account['currency'] == cur:
            ava_bal = account['available_balance']['amount']
            return ava_bal
else:
    print(f"Error: Status Code {res.status}")
    print(f"Response: {res.read().decode('utf-8')}")

In Advanced Trade you should not include query parameters when you generate signature! This info is or at least should be available in documentation!

1 Like

That’s great thanks. Where should the query go ?
Sorry I am just learning.

It should be in request you make to server but should not be included when you generate signature. Read documentation!

I think I understand now. Thank you so much for your help