How to Query Binance Deposit Records via API?
To retrieve Binance deposit records via API, the core method is calling the GET /sapi/v1/capital/deposit/hisrec endpoint with your valid API keys and query parameters, which returns full information including transaction hash, deposit amount, status, number of blockchain confirmations, and more.
Prerequisite: Prepare Your Binance API Keys
Before calling any Binance API endpoints, you need to generate a dedicated API key pair in your Binance account first.
Step-by-Step Operation:
Log in to the official Binance website, click the [User Center] icon in the top right corner, then select [API Management]
Click [Create API], choose either system auto-generation or custom setup
Name your API key (e.g. "Deposit Record Query"), then complete the required security verification
After successful creation, the system will generate API Key and Secret Key. The Secret Key will only be displayed once, copy it immediately and store it in a secure location
Required Permissions: Querying deposit records only requires Read permission, you do not need to enable trading or withdrawal permissions for this use case.
Completion Check: You have a valid API Key and Secret Key pair, and the API key status shows as "Enabled".
Risk Reminder: Your Secret Key is equivalent to your account password. If leaked, unauthorized parties can call APIs to operate your account. It is strongly recommended to enable the IP whitelist restriction, to allow only pre-specified IP addresses to make API calls.
Step 2: Call the Core On-Chain Deposit Query Endpoint
The core endpoint for retrieving on-chain deposit history is GET /sapi/v1/capital/deposit/hisrec.
Endpoint URL:
https://api.binance.com/sapi/v1/capital/deposit/hisrec
Main Request Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| timestamp | LONG | Yes | Current Unix timestamp in milliseconds, it is recommended to use your system's current time |
| coin | STRING | No | Filter records by cryptocurrency ticker, e.g. BTC, USDT |
| status | INT | No | Deposit status: 0 = Pending confirmation, 6 = Arrived but unavailable for withdrawal, 1 = Successful |
| startTime | LONG | No | Query start Unix timestamp, default to 90 days before current time |
| endTime | LONG | No | Query end Unix timestamp, default to current time |
| limit | INT | No | Number of records to return, default 1000, maximum 1000 |
| txId | STRING | No | Exact query by transaction hash |
| includeSource | BOOLEAN | No | Set to true to return the source wallet address of the deposit |
Note: The time interval between startTime and endTime cannot exceed 90 days.
Response Field Description: The endpoint returns structured data including deposit ID, amount, coin ticker, blockchain network, transaction status, destination address, transaction hash, number of confirmations, and other related information.
Success Check: The endpoint returns a full list of deposit records containing the transaction hash, amount, and status fields.
Step 3: Filter Records by Custom Conditions
Scenario A: Query records of a specific coin in the last 30 days
Request example: GET /sapi/v1/capital/deposit/hisrec?coin=USDT&status=1&startTime=[start_timestamp]&endTime=[end_timestamp]
Scenario B: Query a single record with transaction hash
Request example: GET /sapi/v1/capital/deposit/hisrec?txId=[target_transaction_hash]
This is the most precise query method, suitable for verifying whether a specific deposit has been credited to your account.
Scenario C: Query pending unconfirmed deposits
Request example: GET /sapi/v1/capital/deposit/hisrec?status=0
status=0 returns records that are still waiting for blockchain confirmation, which can be used to monitor deposit progress.
Step 4: Query Fiat Deposit Records (Dedicated Independent Endpoint)
If you need to query fiat deposits (such as bank transfers, credit card crypto purchases), you cannot use the on-chain deposit endpoint above. There is a separate dedicated endpoint for fiat operations: GET /sapi/v1/fiat/orders.
Request Parameters:
transactionType: Required, 0 = Query deposit records, 1 = Query withdrawal records
beginTime / endTime: Optional, if left blank, the system will return records from the last 30 days by default
page / rows: Pagination parameters, maximum 500 records per page
Step 5: Sub-Account Deposit Query (For Master Account Use Only)
If you are using a master account and want to query deposit records of your linked sub-accounts, call the endpoint GET /sapi/v1/capital/deposit/subHisrec.
Key Parameters:
subAccount: Required, the email address of the target sub-account
Other parameters (coin, status, startTime, etc.) are identical to the core on-chain deposit query endpoint
Success Check: The master account successfully retrieves the full deposit record set of the specified sub-account.
Common Error Troubleshooting
Error Code -2015: Prompt for invalid API key, IP or permission, which usually means the API key lacks required permissions, or your calling IP is not added to the API whitelist.
Empty query result: Check if the queried time range exceeds 90 days, or if the txId value is entered incorrectly. The API only returns data from the last 90 days by default.
Timestamp verification failed: Make sure the timestamp parameter is a millisecond-level Unix timestamp, and the deviation between your local time and Binance server time does not exceed 30 seconds.
FAQs
Q: Do I need to pay to query deposit records via Binance API? No. All Binance query APIs are free to use, but each endpoint has request frequency limits (weight-based rate limit rule). The core on-chain deposit query endpoint has a weight of 1, while the fiat deposit endpoint has a higher weight, do not send requests too frequently.
Q: What do the different values of the status field mean?
0: Pending confirmation, the on-chain transaction is still waiting for block confirmations
1: Successful, the deposit has been fully credited
6: Arrived but unavailable for withdrawal (usually due to security freeze)
7: Abnormal deposit (mismatched network or wrong destination address)
8: Waiting for user confirmation (e.g. Travel Rule requires additional user information)
Q: How to get the full list of supported deposit coins on Binance? Call the GET /sapi/v1/capital/config/getall endpoint, which returns the deposit/withdrawal support status and network information of all listed coins.
Next Steps
After completing the above setup, send a test request via Postman or programming languages (Python/JavaScript) to call GET /sapi/v1/capital/deposit/hisrec?coin=USDT, to confirm that the endpoint returns valid data normally. If you have not generated your API key yet, go to the Binance [API Management] page to create a key pair, save your Secret Key, and enable the IP whitelist immediately after creation.
