# 导入价格接口

### 接口概述

该接口用于批量导入价格数据到系统中，支持一次性导入多条价格数据。新增按照**资产代码**传递资产信息的能力。（原有 V3 版本接口，必须使用 Elven 系统的资产 id 来传递资产信息）

* **请求方式**：`POST`
* **请求 URL**：`https://openapi.elven.com/open/v4/price`

### 请求头参数

<table><thead><tr><th width="202">参数名</th><th width="90">类型</th><th width="64">必填</th><th>说明</th></tr></thead><tbody><tr><td>elven-api-key</td><td>String</td><td>是</td><td>分配给您的API密钥</td></tr><tr><td>elven-api-sign</td><td>String</td><td>是</td><td>请求签名，用于验证请求合法性</td></tr><tr><td>elven-api-timestamp</td><td>String</td><td>是</td><td>请求时间戳，毫秒级</td></tr></tbody></table>

[查看详细说明](https://docs.elven.com/v3/openapi/jie-kou-shou-quan#elven-api-sign)

### 请求参数

#### Body 参数（JSON 格式）

<table><thead><tr><th width="168">参数名</th><th width="105">类型</th><th width="69">必填</th><th>说明</th></tr></thead><tbody><tr><td>priceProviderId</td><td>String</td><td>是</td><td>价格源 ID<br>系统内创建 OpenAPI 类型的价格源后，可在详情页复制价格源ID</td></tr><tr><td>list</td><td>Array</td><td>是</td><td>包含多条价格记录的数组（每次最多支持 5000 条记录）</td></tr></tbody></table>

**list 数组元素**

<table><thead><tr><th width="123">参数名</th><th width="97">类型</th><th width="88">必填</th><th>说明</th></tr></thead><tbody><tr><td>assetID</td><td>String</td><td>否</td><td>币种ID，需区分大小写，可从<a href="/pages/VMit0TXQj6EglCd9Ac96">资产查询接口</a>当前 entity 所支持的币种<br><code>assetID</code>和<code>symbol</code> 至少填写一个<br>都填写时，只会识别<code>assetID</code></td></tr><tr><td>symbol</td><td>String</td><td>否</td><td>币种symbol，需区分大小写，可从<a href="/pages/VMit0TXQj6EglCd9Ac96">资产查询接口</a>当前 entity 所支持的币种<br><code>assetID</code>和<code>symbol</code> 至少填写一个<br>都填写时，只会识别<code>assetID</code></td></tr><tr><td>datetime</td><td>String</td><td>是</td><td>时间，格式为 <code>YYYY-MM-DD HH:mm:ss</code></td></tr><tr><td>price</td><td>Number</td><td>是</td><td>价格</td></tr></tbody></table>

#### 请求示例

```json
{
    "priceProviderId":"0LNz1biTPhUnftbgv8Yc7DwFdC0Nle6a",
    "list":[
        {
            "assetID":"BTC",
             "symbol":"",
            "datetime":"2024-11-20 00:00:00",
            "price":10
        },
         {
            "assetID":"",
             "symbol":"SOL",
            "datetime":"2024-11-20 00:00:00",
            "price":10
        }
    ]
}
```

#### 响应参数

<table><thead><tr><th width="149">参数名</th><th width="117">类型</th><th>说明</th></tr></thead><tbody><tr><td>status</td><td>String</td><td>请求状态（如 <code>success</code>）</td></tr><tr><td>data</td><td>Boolean</td><td>请求结果（如 <code>true</code> 表示成功）</td></tr></tbody></table>

#### 响应示例

````json
```json
{
    "status": "success",
    "data": true,
    "requestId": "02952fee-a0e1-4e0a-b6a3-d3956516d0a6"
}
```
````

### 注意事项

1. **记录数量限制**：每次请求最多支持导入 5000 条价格记录。&#x20;
2. **时间格式**：`datetime` 参数必须严格按照 `YYYY-MM-DD HH:mm:ss` 格式，否则可能导致解析错误。
3. **时区说明**：价格记录的时间将按照系统设置的时区进行处理，如有时区差异，请在导入前调整数据。
4. **数据完整性**：请确保每条价格记录数据完整且准确，避免因错误数据导致导入失败。
5. **价格精度**：`price` 参数的精度应符合实际业务需求，避免超出系统支持范围。


---

# 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.elven.com/v3/chinese/openapi/v4/dao-ru-jia-ge-jie-kou.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.
