# 使用区块链 API

### 1.  创建帐户

**步骤 1**：用户可以在[ **ChainUp Cloud** ](https://cloud.chainup.com/app/register)上注册。

![Sign Up](/files/3sDZhijxoVCODn5VWMsp)

**步骤 2**：使用您新创建的帐户登录   [**ChainUp Cloud**](https://cloud.chainup.com/app/login) 。

![Login](/files/BqfwFVWcBrNRe6Qm9IXQ)

### 2. 用户仪表板

**步骤 1：**&#x767B;录 ,，您需要创建一个新的 API 密钥并选择区块链。

![Create API](/files/7isH7aedp5jr2r08XqgS)

**Step 2:** Now, type in the name of your API and select the blockchain. 步骤 2：现在，输入您的 API 名称并选择区块链。

![Select Blockchain](/files/SCYsgOzHpQwVuO3yUo4y)

&#x20;**步骤 3：**&#x521B;建 API 后，您将可以在项目的 API 面板下访问 API 密钥，您可以在其中查看、复制、创建和删除您的 API 密钥。您还可以查看有关 API 使用情况的其他统计信息。

![View API key](/files/XqyFgwH8hMPacJz63xPk)

**步骤 4**：您还可以向下滚动以获取有关集成的更多信息。

![Integration guide](/files/cUM3tWcKsI5obOF8HjA7)

**步骤 5：**&#x60A8;可以进一步向下滚动以配置 API 的设置。

![Configure API settings](/files/CtP26I4E89tUqdBlwkH1)

**步骤 6：**&#x60A8;可以返回仪表板 API 面板以概览所有 API。

![API Overview](/files/hHkzoCVJ3DEv3LJE0Dsl)

### 3. Accessing the Blockchain 访问区块链

在此示例中，我们将访问 Polkadot 区块链。

**步骤 1：**&#x5411;下滚动到集成部分时，您将获得此服务的 URL。

![Integration guide](/files/cUM3tWcKsI5obOF8HjA7)

**步骤 2：**&#x6839;据您的设置，有几种方法可以使用您的 API 密钥。您可以使用 JSON-RPC、WebSocket 等。以下是 curl 示例：

```
curl -i -X POST  -H 'content-type: application/json' --data '{"jsonrpc":"2.0","method":"chain_getBlock","params":[],"id":32}'  https://api.chainup.net/polkadot/polkadot/93f01aa89fe14a5a9fc1a4c11f6087af
```

&#x20;或者您可以使用 WebSocket 进行连接：

```
wscat -c  wss://api.chainup.net/ws/polkadot/polkadot/93f01aa89fe14a5a9fc1a4c11f6087af
```

[**立即注册**](https://cloud.chainup.com/app/register)，在几秒钟内开始构建并探索 ChainUp Cloud 的奇妙之处！


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chainupcloud.com/zhong-wen/introduction/for-developers/use-blockchain-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
