🔌 钱包数据管理API接口文档

完整的API接口说明和使用示例

1,188
总钱包数
2,813,194
总余额 (BTC)
54.84%
数据更新成功率
7
API接口数量

📋 接口概述

接口地址: https://web.web3huifu.fun/api/update_wallet.php

请求方式: POST GET PUT

数据格式: JSON

字符编码: UTF-8

🔐 认证方式

所有API请求都需要在请求头中包含API密钥:

X-API-Key: wallet_api_2024

可用的API密钥

📊 支持的API操作

💡 快速导航:

  • 🆕 创建新钱包: 使用 create_wallet - 不需要现有ID
  • 🔄 更新现有钱包: 使用 update_wallet - 需要现有ID
  • 🔍 查找钱包: 使用 get_wallet - 可通过ID/地址/哈希查找

🆕 创建钱包记录 (create_wallet)

创建新的钱包记录,无需现有ID

POST /api/update_wallet.php

请求参数

参数名 类型 必填 说明
action string 操作类型,固定值: create_wallet
wallet_hash string 钱包哈希值
filename string 文件名 (用于钱包名称)
source string 来源 (默认: web_extractor)
addresses array 地址数组 (支持多地址)
files array 文件数组 (支持多文件)
password_hints array 密码提示数组
balances array 余额数组 (多币种支持)
tags array 标签数组

基础创建示例

curl -X POST "https://web.web3huifu.fun/api/update_wallet.php" \ -H "Content-Type: application/json" \ -H "X-API-Key: wallet_api_2024" \ -d '{ "action": "create_wallet", "wallet_hash": "daed8dfae75c8fac6b2db3e77b9b77e54ad3d8a72f68c9d4e14d7b0bd4b23b8b", "filename": "重要钱包文件", "source": "手动导入" }'

完整创建示例(包含多值字段)

curl -X POST "https://web.web3huifu.fun/api/update_wallet.php" \ -H "Content-Type: application/json" \ -H "X-API-Key: wallet_api_2024" \ -d '{ "action": "create_wallet", "wallet_hash": "daed8dfae75c8fac6b2db3e77b9b77e54ad3d8a72f68c9d4e14d7b0bd4b23b8b", "filename": "重要钱包文件", "source": "手动导入", "addresses": [ { "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "address_type": "legacy", "is_primary": true, "balance": 0.01 } ], "files": [ { "file_name": "wallet.dat", "file_path": "/path/to/wallet.dat", "file_type": "dat", "is_primary": true } ], "password_hints": [ "密码包含数字和字母", "可能与生日相关" ], "tags": ["高价值", "优先处理"] }'

成功响应示例

{ "success": true, "message": "钱包创建成功", "data": { "wallet_id": 1367, "wallet_hash": "daed8dfae75c8fac6b2db3e77b9b77e54ad3d8a72f68c9d4e14d7b0bd4b23b8b", "message": "新钱包记录已创建", "multivalue_data": { "success": true, "data": { "addresses": [ { "success": true, "message": "地址添加成功", "id": 123 } ], "files": [ { "success": true, "message": "文件添加成功", "id": 45 } ] } }, "is_associated": false }, "timestamp": "2024-01-09 16:30:00" }

JavaScript创建钱包示例

// 创建钱包的JavaScript函数 async function createWallet(walletData) { const response = await fetch('/api/update_wallet.php', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'wallet_api_2024' }, body: JSON.stringify({ action: 'create_wallet', wallet_hash: walletData.hash, filename: walletData.filename, source: walletData.source || 'web_extractor' }) }); return await response.json(); } // 使用示例 createWallet({ hash: 'your_wallet_hash_here', filename: 'My Wallet', source: 'manual_upload' }).then(result => { console.log('钱包创建成功:', result); });

2. 更新钱包信息 (update_wallet)

更新单个钱包的各种字段信息

POST /api/update_wallet.php

请求参数

参数名 类型 必填 说明
action string 操作类型,固定值: update_wallet
wallet_id integer 钱包ID
wallet_address string 钱包地址
balance decimal 余额
password_hint string 密码提示
wallet_hash string 钱包哈希
crack_status string 破解状态 (未开始/进行中/已完成/失败/测试中/批量测试/暂停/错误)
cracked_password string 已破解的密码
description string 钱包描述信息
crack_notes string 破解备注
crack_attempts integer 破解尝试次数
crack_time string 破解耗时

请求示例

curl -X POST "https://web.web3huifu.fun/api/update_wallet.php" \ -H "Content-Type: application/json" \ -H "X-API-Key: wallet_api_2024" \ -d '{ "action": "update_wallet", "wallet_id": 123, "balance": 100.5, "password_hint": "密码包含数字和字母", "crack_status": "已完成", "cracked_password": "mypassword123", "description": "高价值BTC钱包,需要优先处理", "crack_notes": "使用GPU加速破解成功", "crack_attempts": 1500, "crack_time": "2小时30分钟" }'

成功响应

{ "success": true, "message": "钱包信息更新成功", "data": { "id": 123, "wallet_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "balance": "100.50000000", "password_hint": "密码包含数字和字母", "crack_status": "已完成", "cracked_password": "mypassword123", "description": "高价值BTC钱包,需要优先处理", "crack_notes": "使用GPU加速破解成功", "crack_attempts": 1500, "crack_time": "2小时30分钟" }, "timestamp": "2024-09-04 15:30:00" }

3. 获取钱包信息 (get_wallet)

根据ID、地址或哈希获取钱包信息

POST /api/update_wallet.php

请求参数

参数名 类型 必填 说明
action string 操作类型,固定值: get_wallet
wallet_id integer 钱包ID (三选一)
wallet_address string 钱包地址 (三选一)
wallet_hash string 钱包哈希 (三选一)

请求示例

curl -X POST "https://web.web3huifu.fun/api/update_wallet.php" \ -H "Content-Type: application/json" \ -H "X-API-Key: wallet_api_2024" \ -d '{ "action": "get_wallet", "wallet_id": 123 }'

4. 获取所有钱包信息 (get_all_wallets)

获取所有钱包信息,支持分页、筛选和排序

POST /api/update_wallet.php

请求参数

参数名 类型 必填 说明
action string 操作类型,固定值: get_all_wallets
page integer 页码 (默认: 1)
limit integer 每页数量 (默认: 50, 最大: 1000)
currency string 货币类型筛选 (BTC, BCH, LTC, DOGE)
crack_status string 破解状态筛选
warning_level string 警告级别筛选 (low/medium/high/critical)
has_address string 是否只获取有地址的钱包 (true/false)
has_hash string 是否只获取有哈希的钱包 (true/false)
order_by string 排序字段 (默认: id)
order_dir string 排序方向 (ASC/DESC, 默认: ASC)

请求示例

curl -X POST "https://web.web3huifu.fun/api/update_wallet.php" \
-H "Content-Type: application/json" \
-H "X-API-Key: wallet_api_2024" \
-d '{
  "action": "get_all_wallets",
  "page": 1,
  "limit": 100,
  "currency": "BTC",
  "has_address": "true",
  "order_by": "balance",
  "order_dir": "DESC"
}'

成功响应

{
  "success": true,
  "message": "获取钱包列表成功",
  "data": {
    "wallets": [
      {
        "id": 1,
        "wallet_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
        "wallet_hash": "abc123...",
        "balance": "100.50000000",
        "crack_status": "已完成",
        "currency_type": "BTC"
      }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 100,
      "total": 1188,
      "total_pages": 12,
      "has_next": true,
      "has_prev": false
    },
    "filters": {
      "currency": "BTC",
      "has_address": "true"
    },
    "sort": {
      "order_by": "balance",
      "order_dir": "DESC"
    }
  },
  "timestamp": "2024-09-04 15:30:00"
}

5. 搜索钱包 (search_wallets)

根据条件搜索钱包列表

POST /api/update_wallet.php

请求参数

参数名 类型 必填 说明
action string 操作类型,固定值: search_wallets
search string 搜索关键词 (地址、哈希、密码提示、钱包名称)
currency string 货币类型筛选 (BTC, BCH, LTC, DOGE)
warning_level string 警告级别筛选 (low/medium/high/critical)
crack_status string 破解状态筛选
page integer 页码 (默认: 1)
limit integer 每页数量 (默认: 20, 最大: 100)

请求示例

curl -X POST "https://web.web3huifu.fun/api/update_wallet.php" \ -H "Content-Type: application/json" \ -H "X-API-Key: wallet_api_2024" \ -d '{ "action": "search_wallets", "search": "BTC", "currency": "BTC", "warning_level": "high", "crack_status": "已完成", "page": 1, "limit": 20 }'

6. 更新破解状态 (update_crack_status)

专门用于更新钱包的破解相关信息

POST /api/update_wallet.php

请求示例

curl -X POST "https://web.web3huifu.fun/api/update_wallet.php" \ -H "Content-Type: application/json" \ -H "X-API-Key: wallet_api_2024" \ -d '{ "action": "update_crack_status", "wallet_id": 123, "crack_status": "已完成", "cracked_password": "password123", "crack_method": "Hashcat", "crack_progress": "100%", "crack_notes": "使用GPU加速破解" }'

7. 批量更新 (batch_update)

批量更新多个钱包信息

POST /api/update_wallet.php

请求示例

curl -X POST "https://web.web3huifu.fun/api/update_wallet.php" \ -H "Content-Type: application/json" \ -H "X-API-Key: wallet_api_2024" \ -d '{ "action": "batch_update", "updates": [ { "wallet_id": 123, "crack_status": "已完成", "cracked_password": "password1" }, { "wallet_id": 124, "crack_status": "进行中", "crack_progress": "50%" } ] }'

8. 获取统计信息 (get_statistics)

获取数据库统计信息

GET /api/update_wallet.php?action=get_statistics&api_key=wallet_api_2024

请求示例

curl -X GET "https://web.web3huifu.fun/api/update_wallet.php?action=get_statistics&api_key=wallet_api_2024"

响应示例

{ "success": true, "message": "获取统计信息成功", "data": { "total": 1188, "by_currency": [ {"currency_type": "BTC", "count": 1187}, {"currency_type": "DOGE", "count": 1} ], "by_warning": [ {"warning_level": "low", "count": 10}, {"warning_level": "medium", "count": 306}, {"warning_level": "high", "count": 689}, {"warning_level": "critical", "count": 183} ], "by_crack_status": [ {"crack_status": "未开始", "count": 1163}, {"crack_status": "进行中", "count": 2}, {"crack_status": "已完成", "count": 23} ], "balance": { "total": 881, "total_balance": "2813194.44661436", "avg_balance": "3193.183253818797", "max_balance": "198029.00000000" } }, "timestamp": "2024-09-04 15:30:00" }

📝 响应格式

所有API响应都使用统一的JSON格式:

{ "success": true|false, "message": "操作结果描述", "data": {}, // 具体数据 (可选) "timestamp": "2024-09-04 15:30:00" }

成功响应示例

{ "success": true, "message": "操作成功", "data": { // 具体数据 }, "timestamp": "2024-09-04 15:30:00" }

错误响应示例

{ "success": false, "message": "错误描述", "data": null, "timestamp": "2024-09-04 15:30:00" }

🚨 错误代码

HTTP状态码 说明
200 成功
400 请求参数错误
401 API密钥无效
404 资源不存在
405 请求方法不支持
500 服务器内部错误

💡 使用示例

Python示例

import requests import json # API配置 API_URL = "https://web.web3huifu.fun/api/update_wallet.php" API_KEY = "wallet_api_2024" # 创建钱包记录 def create_wallet(wallet_hash, **kwargs): headers = { "Content-Type": "application/json", "X-API-Key": API_KEY } data = { "action": "create_wallet", "wallet_hash": wallet_hash, **kwargs } response = requests.post(API_URL, headers=headers, json=data) return response.json() # 更新钱包信息 def update_wallet(wallet_id, **kwargs): headers = { "Content-Type": "application/json", "X-API-Key": API_KEY } data = { "action": "update_wallet", "wallet_id": wallet_id, **kwargs } response = requests.post(API_URL, headers=headers, json=data) return response.json() # 使用示例 result = update_wallet( wallet_id=123, crack_status="已完成", cracked_password="mypassword123", crack_method="Hashcat" ) print(result)

JavaScript示例

// 创建钱包记录 async function createWallet(walletData) { const response = await fetch('/api/update_wallet.php', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'wallet_api_2024' }, body: JSON.stringify({ action: 'create_wallet', wallet_hash: walletData.wallet_hash, filename: walletData.filename, source: walletData.source || 'web_extractor' }) }); return await response.json(); } // 更新钱包信息 async function updateWallet(walletId, updates) { const response = await fetch('https://web.web3huifu.fun/api/update_wallet.php', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'wallet_api_2024' }, body: JSON.stringify({ action: 'update_wallet', wallet_id: walletId, ...updates }) }); return await response.json(); } // 使用示例 updateWallet(123, { crack_status: '已完成', cracked_password: 'mypassword123' }).then(result => { console.log(result); });

PHP示例

<?php // 创建钱包记录 function createWallet($walletHash, $updates = []) { $url = 'https://web.web3huifu.fun/api/update_wallet.php'; $data = array_merge([ 'action' => 'create_wallet', 'wallet_hash' => $walletHash ], $updates); $options = [ 'http' => [ 'header' => [ "Content-Type: application/json", "X-API-Key: wallet_api_2024" ], 'method' => 'POST', 'content' => json_encode($data) ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); return json_decode($result, true); } // 更新钱包信息 function updateWallet($walletId, $updates) { $url = 'https://web.web3huifu.fun/api/update_wallet.php'; $data = array_merge([ 'action' => 'update_wallet', 'wallet_id' => $walletId ], $updates); $options = [ 'http' => [ 'header' => [ "Content-Type: application/json", "X-API-Key: wallet_api_2024" ], 'method' => 'POST', 'content' => json_encode($data) ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); return json_decode($result, true); } // 使用示例 $result = updateWallet(123, [ 'crack_status' => '已完成', 'cracked_password' => 'mypassword123' ]); print_r($result); ?>

🔧 集成建议

📊 最新数据统计

34
成功更新记录
62
处理钱包块
54.84%
更新成功率
100%
API测试通过率

📞 技术支持

如有问题,请联系技术支持团队。

文档版本: v1.0

最后更新: 2024年9月4日

API版本: v1.0