Chuyển đến nội dung chính

Endpoint RPC miễn phí của Base và Chain ID

Base có Chain ID 8453; endpoint RPC công khai không cần khóa là https://api.blockvectra.com/v1/base_mainnet/public (3 yêu cầu mỗi giây cho mỗi IP), còn eth_getLogs cần khóa API.

Nhà phát triển và AI Agent có thể kết nối ví và xây dựng ứng dụng bằng API HTTP.

Điểm cuối RPC và thông số mạng

Mạng chính

https://api.blockvectra.com/v1/base_mainnet/public

Thử RPC không cần khóa API

curl -sS 'https://api.blockvectra.com/v1/base_mainnet/public' \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'

Thêm mạng vào ví

Sao chép các giá trị này vào biểu mẫu mạng tùy chỉnh của ví.

{
  "networkName": "Base",
  "rpcUrl": "https://api.blockvectra.com/v1/base_mainnet/public",
  "chainId": 8453,
  "currencySymbol": "ETH",
  "blockExplorerUrl": "https://basescan.org"
}
basescan.org

Webhook thông báo chuyển tiền đến

Nhận hoạt động địa chỉ tại điểm cuối HTTPS. Theo hướng dẫn để tạo đăng ký, xác minh chữ ký và loại bỏ thông báo trùng lặp.

Base

Webhook thông báo chuyển tiền đến

Hướng dẫn tích hợp

Endpoint

Không cần API key. Chỉ hỗ trợ phương thức ví, giới hạn tốc độ theo IP. Xem phương thức và giới hạn hiện tại tại GET /v1/chains.

Điểm cuối RPC công khai miễn phí
https://api.blockvectra.com/v1/base_mainnet/public
curl -X POST 'https://api.blockvectra.com/v1/base_mainnet/public' -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
Giới hạn tốc độ: 3 yêu cầu/giây mỗi IP, burst 20, lô tối đa 10
Giới hạn gửi giao dịch: 1 yêu cầu/giây mỗi IP, burst 3
Phương thức công khai
  • eth_chainId
  • net_version
  • eth_blockNumber
  • eth_getBalance
  • eth_getTransactionCount
  • eth_getCode
  • eth_getStorageAt
  • eth_call
  • eth_estimateGas
  • eth_gasPrice
  • eth_maxPriorityFeePerGas
  • eth_feeHistory
  • eth_getBlockByNumber
  • eth_getBlockByHash
  • eth_getTransactionByHash
  • eth_getTransactionReceipt
  • eth_syncing
  • web3_clientVersion
  • eth_sendRawTransaction
Tất cả điểm cuối RPC công khai miễn phí
Lịch sử công khai: 1,000 khối gần nhất. Đăng ký miễn phí để dùng tín dụng API miễn phí cho các phương thức được chuỗi này hỗ trợ.
JSON-RPC (Khóa trên đường dẫn)
https://api.blockvectra.com/v1/base_mainnet/{api_key}
JSON-RPC (header: x-api-key)
https://api.blockvectra.com/v1/base_mainnet
x-api-key: {api_key}
Data API
https://api.blockvectra.com/v1/data/base_mainnet
x-api-key: {api_key}

WebSocket

WebSocket (Khóa trên đường dẫn)
wss://api.blockvectra.com/v1/base_mainnet/{api_key}
WebSocket (header: x-api-key hoặc Authorization)
wss://api.blockvectra.com/v1/base_mainnet
x-api-key: {api_key}
Authorization: Bearer {api_key}
Các loại subscription được hỗ trợ
  • newHeads
  • logs (bộ lọc phải bao gồm address hoặc topic0)

Thông số mạng

Chain ID8453
Điểm cuối RPC công khai miễn phíhttps://api.blockvectra.com/v1/base_mainnet/public
Số phương thức dùng khóa API39
Data APIĐược hỗ trợ
Hỗ trợ WebSocketĐược hỗ trợ
Thông báo WebhookĐược hỗ trợ · Số xác nhận 1–519 (mặc định 1)
Hướng dẫn thông báo Webhook
Gửi giao dịchĐược hỗ trợ
Gửi giao dịch (endpoint công khai không cần key)Được hỗ trợ
Cửa sổ lịch sử trạng tháiTrạng thái lịch sử cho 10,000 khối gần đây nhất
Khoảng khối tối đa của eth_getLogs1,000 khối
Tập dữ liệu Data APIKhối, Giao dịch, Giao dịch địa chỉ, Chuyển token, Siêu dữ liệu token, Độ mới dữ liệu
Các loại subscription được hỗ trợnewHeads, logs
Mạng thử nghiệm liên quanKhông xác định
Hướng dẫn liên quanBase

Ví dụ nhanh

curl -X POST https://api.blockvectra.com/v1/base_mainnet \
  -H "Content-Type: application/json" \
  -H "x-api-key: {api_key}" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

Giới hạn

Cửa sổ lịch sử trạng tháiTrạng thái lịch sử cho 10,000 khối gần đây nhất
Khoảng khối tối đa của eth_getLogs1,000 khối
Chính sách phương thức
Cho phép: eth_blockNumber, eth_chainId, eth_gasPrice, eth_maxPriorityFeePerGas, eth_blobBaseFee, eth_feeHistory, eth_syncing, eth_getBalance, eth_getCode, eth_getStorageAt, eth_getTransactionCount, eth_call, eth_estimateGas, eth_createAccessList, eth_getProof, eth_simulateV1, eth_getBlockByNumber, eth_getBlockByHash, eth_getBlockReceipts, eth_getBlockTransactionCountByNumber, eth_getBlockTransactionCountByHash, eth_getTransactionByHash, eth_getTransactionReceipt, eth_getTransactionByBlockNumberAndIndex, eth_getTransactionByBlockHashAndIndex, eth_getRawTransactionByHash, eth_getRawTransactionByBlockHashAndIndex, eth_getRawTransactionByBlockNumberAndIndex, eth_getLogs, eth_getUncleCountByBlockNumber, eth_getUncleCountByBlockHash, eth_getUncleByBlockNumberAndIndex, eth_getUncleByBlockHashAndIndex, eth_getHeaderByNumber, eth_getHeaderByHash, eth_sendRawTransaction, net_version, web3_clientVersion, web3_sha3

Data API

Kiểm tra độ mới dữ liệu chuỗi

curl -s "https://api.blockvectra.com/v1/data/base_mainnet/status/freshness" -H "x-api-key: {api_key}"

Xem hướng dẫn tập dữ liệu →

Xem tài liệu Data API →

Chọn tác vụ

Giải pháp cho tác vụ onchain

Bước tiếp theo với khóa API

eth_getLogs

set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/base_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/base_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
eth_getLogs

Data API

curl -fsS 'https://api.blockvectra.com/v1/data/base_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
Data API

WebSocket

echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/base_mainnet'
WebSocket

Câu hỏi thường gặp

Điểm cuối RPC và Chain ID của Base là gì?

Base có Chain ID 8453; endpoint RPC công khai không cần khóa là https://api.blockvectra.com/v1/base_mainnet/public (3 yêu cầu mỗi giây cho mỗi IP), còn eth_getLogs cần khóa API.

Có thể thử RPC Base mà không cần khóa API không?

Có. Gọi eth_chainId tại các điểm cuối công khai ở trên mà không cần khóa. GET /v1/chains liệt kê phương thức và giới hạn theo IP hiện tại.

Base RPC có hỗ trợ WebSocket không?

Base RPC hỗ trợ kết nối WebSocket. Các loại subscription được hỗ trợ: newHeads, logs.

Base RPC có hỗ trợ các phương thức trace hoặc debug không?

Các phương thức trace và debug không được hỗ trợ cho Base RPC.

Tôi có thể phát giao dịch qua RPC của Base không?

Base: Được hỗ trợ.

Tôi có thể truy vấn trạng thái lịch sử trong phạm vi nào trên Base?

Base: Trạng thái lịch sử cho 10,000 khối gần đây nhất.

Giới hạn phạm vi khối của eth_getLogs trên Base là bao nhiêu?

Base: 1,000 khối, còn eth_getLogs cần khóa API.

Những tập dữ liệu Data API nào có trên Base?

Base: Khối, Giao dịch, Giao dịch địa chỉ, Chuyển token, Siêu dữ liệu token, Độ mới dữ liệu.

Giá cả

Nhận 30,000,000 CU khi đăng ký, nạp lại sau mỗi 30 ngày (số dư và giới hạn tốc độ được gộp chung giữa các chuỗi; không cần thẻ tín dụng); tính giá cho mỗi triệu lệnh gọi: eth_blockNumber $0.10, eth_call $1.50, eth_getLogs $3.00.

Xem các gói giá →