-
Notifications
You must be signed in to change notification settings - Fork 670
Description
-
Issue Summary
Subject: Unable to Retrieve Historical Trade Data via API Beyond a Certain Date Threshold -
Problem Description
I am experiencing a critical issue with the Binance Spot API endpoint GET /api/v3/myTrades. While the API successfully returns recent trades (demonstrated by receiving 9 BTCUSDT trades from later periods), it returns empty results ([]) when querying for trades from specific dates in October-November 2021 when I know trades occurred.
Technical Details:
API Endpoint: GET /api/v3/myTrades
Authentication: Valid API keys with necessary permissions (trade history enabled)
Timeframe Tested: October 18, 22, 23 and November 18, 22, 2021
Symbol: BTCUSDT (also tested with alternative pairs)
Current Behavior: Returns empty array [] instead of expected trade history
API Response: HTTP 200 with empty data, no error codes
- Evidence of Account Activity
I have confirmed trades occurred on these dates through:
Manual CSV export from Binance web interface (showing trades on specified dates)
Email confirmations from Binance for executed trades
Portfolio records showing position changes during these periods
- Technical Verification Performed
Test 1: Recent Trades (Successful)
python
Returns 9 trades successfully
trades = client.get_my_trades(symbol="BTCUSDT", limit=1000)
Result: 9 trades returned (mixed dates)
Test 2: Specific 2021 Dates (Failing)
python
October 18, 2021 (00:00:00 to 23:59:59)
start_ms = 1634508000000
end_ms = 1634594399999
trades = client.get_my_trades(
symbol="BTCUSDT",
start_time_ms=start_ms,
end_time_ms=end_ms,
limit=1000
)
Result: Empty array []
Test 3: Alternative Approaches Tried
Different symbols: BTCBUSD, BTCTRY, BTCUSDC
Without time parameters: Using only fromId pagination
Smaller time windows: 1-hour increments throughout the day
Different API rate limits: Added delays between requests
- API Configuration & Permissions
API Key Settings:
Read-Only Trading: ✅ Enabled
Enable Trading: ✅ Enabled
Enable Withdrawals: ❌ Disabled (not needed)
Account Verification:
Account Level: Verified (KYC completed)
Account Age: [Please insert your account creation date]
Regional Compliance: Fully compliant with terms of service
- Requested Information from Binance Support
To help diagnose this issue, I kindly request:
A. Technical Clarification:
What is the actual historical limit for the GET /api/v3/myTrades endpoint?
Is there a fixed date cutoff (e.g., "trades older than X months")?
Does this vary by account type, region, or trading volume?
Is there an alternative endpoint or method to retrieve older trade history?
Bulk export options via API
Special permission requests for full history
Are there any known limitations or bugs with historical data retrieval from 2021?
B. Account-Specific Checks:
Can you verify if trades from October-November 2021 exist in my account records?
Are there any account flags or restrictions affecting historical data access?
Is there a data migration or archiving process that might affect availability?
C. Required Information from My Side:
Please let me know what specific details you need from me to investigate:
Binance UID: [I will provide upon request]
API Key (masked): [I will provide first/last characters]
Specific Trade IDs from the affected period (from CSV records)
Screenshots of trades from web interface
Any authentication logs or diagnostic information needed
- Impact & Business Need
This issue prevents:
Accurate portfolio accounting and tax reporting
Performance analysis and strategy backtesting
Compliance with financial record-keeping requirements
Migration to other portfolio tracking systems
- Suggested Resolution Paths
Preferred: Fix the API endpoint to return all historical trades regardless of date
Alternative: Provide a dedicated endpoint or bulk export for full trade history
Workaround: Official confirmation of date limits with documentation update
- Attachments (Available Upon Request)
Screenshots of trades from Binance web interface (2021 dates)
CSV export samples showing missing trades
Full API request/response logs with timestamps
Python test scripts demonstrating the issue