Make Your First Alchemy Request

Learn how to send a blockchain request using Alchemy.

👋 Don’t have an API Key? Start here before making your first request!

You can interact with Alchemy’s infrastructure provider using JSON-RPC and your command line.

Let’s make a call to eth_gasPrice, so we’ll fill this in as our method.

Simply replace demo with your Alchemy API Key and you can run this from the command line to retrieve the current gas price:

shell
$curl https://eth-mainnet.g.alchemy.com/v2/demo \
>-X POST \
>-H "Content-Type: application/json" \
>-d '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":73}'

Results:

Result
1{ "id": 73,
2 "jsonrpc": "2.0",
3 "result": "0x09184e72a000" // 10000000000000 }

Next Steps

Congratulations on making your first Alchemy request! 🎉

Next, we recommend you check out setting up Alchemy with Viem or any web3 library using AI!