From the console, copy the JSON-RPC endpoint that matches
the network and location combination you need.
Now you can begin making requests. A full list of all the RPC methods
available are listed in the RPC API reference
documentation. Our example request calls the eth_blockNumber method.
JSON_RPC_ENDPOINT is an endpoint you copied from the
console. This endpoint includes a default API key that has been automatically
created. You can manage all of your keys on the Credentials
page.
After executing this curl request, you should see a response like:
{"jsonrpc":"2.0","id":1,"result":"0x13acb8d"}
Using WebSocket subscriptions
WebSocket support is also enabled for Blockchain RPC endpoints. This example uses
the wscat open source project.
In the Google Cloud console, go to the Blockchain RPC page.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis product is in a Pre-GA stage, meaning it's available "as is" with potentially limited support, as detailed in the Pre-GA Offerings Terms within the General Service Terms.\u003c/p\u003e\n"],["\u003cp\u003eThe product provides JSON-RPC and WebSocket endpoints for interacting with the blockchain.\u003c/p\u003e\n"],["\u003cp\u003eYou can access and copy both the JSON-RPC and WebSocket endpoints from the Blockchain RPC page in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eThe RPC API documentation offers a list of available methods, such as \u003ccode\u003eeth_blockNumber\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can use \u003ccode\u003ewscat\u003c/code\u003e to connect to the WebSocket endpoint and create subscriptions, such as subscribing to new block headers.\u003c/p\u003e\n"]]],[],null,["# Quickstart: Blockchain RPC\n\n| **Preview**\n|\n|\n| This product is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nUsing the RPC endpoint\n----------------------\n\n1. In the Google Cloud console, go to the Blockchain RPC page.\n\n\n [Go Blockchain RPC](https://console.cloud.google.com/blockchain/rpc)\n2. From the console, copy the JSON-RPC endpoint that matches\n the `network` and `location` combination you need.\n\n\n \u003cbr /\u003e\n\n3. Now you can begin making requests. A full list of all the RPC methods\n available are listed in the [RPC API](/blockchain-rpc/docs/rpc-api) reference\n documentation. Our example request calls the `eth_blockNumber` method.\n\n curl -X POST -H \"Content-Type: application/json\" -d '{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\":\n \"eth_blockNumber\",\n \"params\": []}' \\\n \u003cvar translate=\"no\"\u003eJSON_RPC_ENDPOINT\u003c/var\u003e\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003eJSON_RPC_ENDPOINT\u003c/var\u003e is an endpoint you copied from the console. This endpoint includes a default API key that has been automatically created. You can manage all of your keys on the [Credentials](/apis/credentials) page.\n\nAfter executing this curl request, you should see a response like: \n\n {\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x13acb8d\"}\n\nUsing WebSocket subscriptions\n-----------------------------\n\nWebSocket support is also enabled for Blockchain RPC endpoints. This example uses\nthe [wscat](https://github.com/websockets/wscat) open source project.\n\n1. In the Google Cloud console, go to the Blockchain RPC page.\n\n\n [Go Blockchain RPC](https://console.cloud.google.com/blockchain/rpc)\n2. From the console, copy the WebSocket endpoint that matches\n the `network` and `location` combination you need.\n\n\n \u003cbr /\u003e\n\n3. Now you can begin making requests.\n\n wscat -c \u003cvar translate=\"no\"\u003eWS_ENDPOINT\u003c/var\u003e\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003eWS_ENDPOINT\u003c/var\u003e is a WebSocket endpoint from the console.\n\nSubscribe to new block headers: \n\n {\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"eth_subscribe\",\"params\":[\"newHeads\"]}\n\nYou'll start receiving messages for each new block header."]]