TheRPCを始める
APIリファレンス
イーサリアムAPI
Core API
ガイド

Curl

This guide demonstrates how to interact with Ethereum nodes directly using Curl commands. This is useful for testing, debugging, and understanding the underlying API calls.

ご注意ください!
こんにちは!友好的な注意点:このページは、 Curl/Http リクエストの操作に関する確かな概要を提供することを目的としています。実践的なコード例については、 API Methods documentation をチェックしてください。そこにはすべてのサポートされている言語ですぐに使用できる例があります!

Basic Usage

Here's a basic example of getting the latest block number:

curl -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  YOUR_ETHEREUM_NODE_URL

Authentication

When using authenticated endpoints:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  YOUR_ETHEREUM_NODE_URL

Common Operations

Get Balance

curl -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x742d35Cc6634C0532925a3b844Bc454e4438f44e","latest"],"id":1}' \
  YOUR_ETHEREUM_NODE_URL

Get Transaction

curl -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],"id":1}' \
  YOUR_ETHEREUM_NODE_URL

See also

より良くするためにご協力ください!
このページを共有して、より良い製品を作るのに協力してください。