# 导出查询结果

导出查询结果

ID: results:export · Region: cn · Status: available

catalog_version: 5c920c774a55e44d7e8c709143b88a18b8b2afcef91a5d19a8c9ae5d565d9077
updated_at: 2026-10-21T12:06:16.523771+00:00

导出查询结果

历史数据以数据集发布版本定义覆盖周期；实时读取反映请求时资料，不保证覆盖全部记录。

Docs: https://docs.asklear.cn/capabilities/results%3Aexport

## POST /v1/export

legacy · available · api_key, oauth

REST 需要客户 API Key；MCP 需要已开放的服务及现有授权；CLI 需要已发布且包含该命令的客户端。



执行遵循现有计价；读取公开说明不扣 Credits。

请求声明 idempotency_key 时，同一次操作复用原键；元数据 GET 只读。

等待态响应提供结果/状态引用。先读取原结果；超时或结果不明时禁止自动重新提交付费执行。401/403/422 应先修正鉴权、权限或输入。

### Input schema / 输入契约

```json
{
  "$defs": {
    "Schema1": {
      "description": "Metric query shape for asynchronous exports, independent of page size.",
      "properties": {
        "approved_plan_digest": {
          "anyOf": [
            {
              "pattern": "^plan_[0-9a-f]{64}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "dataset": {
          "description": "Dataset ID; use an enabled dataset for the requested native route.",
          "type": "string"
        },
        "dry_run": {
          "default": false,
          "description": "Set true only when the user asks for a price preview.",
          "type": "boolean"
        },
        "filters": {
          "description": "Aligned query scope. Resolve user-supplied brand, shop, and category names with search_values; product/shop URLs are values for product_id/shop_id.",
          "items": {
            "$ref": "#/$defs/Schema3"
          },
          "type": "array"
        },
        "group_by": {
          "description": "Exact public result dimensions. Include month for a monthly trend; for entity results include the declared ID, name, and URL fields.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "limit": {
          "default": 100,
          "maximum": 1000000,
          "minimum": 1,
          "type": "integer"
        },
        "max_credits": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "metrics": {
          "description": "Public metrics requested by the user; do not add unrequested metrics.",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        },
        "order_by": {
          "description": "Sort by a returned metric or groupable dimension.",
          "items": {
            "$ref": "#/$defs/Schema2"
          },
          "type": "array"
        },
        "time": {
          "$ref": "#/$defs/Schema4",
          "description": "Absolute range or last_complete_months; relative time needs no describe."
        }
      },
      "required": [
        "dataset",
        "metrics",
        "time"
      ],
      "type": "object"
    },
    "Schema2": {
      "properties": {
        "dir": {
          "default": "asc",
          "enum": [
            "asc",
            "desc"
          ],
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      },
      "required": [
        "field"
      ],
      "type": "object"
    },
    "Schema3": {
      "properties": {
        "field": {
          "description": "Public dimension used to scope the query.",
          "type": "string"
        },
        "op": {
          "description": "Use eq with one platform raw value already returned by search_values or earlier context; use in with all relevant returned raw values.",
          "enum": [
            "eq",
            "neq",
            "in",
            "not_in",
            "gt",
            "gte",
            "lt",
            "lte",
            "contains",
            "is_unknown",
            "is_known"
          ],
          "type": "string"
        },
        "value": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Single operand for eq, neq, comparisons, or contains."
        },
        "values": {
          "anyOf": [
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Platform raw values used by in or not_in."
        }
      },
      "required": [
        "field",
        "op"
      ],
      "type": "object"
    },
    "Schema4": {
      "properties": {
        "end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inclusive end month/date. Use together with start."
        },
        "grain": {
          "const": "month",
          "default": "month",
          "type": "string"
        },
        "last_complete_months": {
          "anyOf": [
            {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Server-resolved latest complete months ending at the authenticated data-through month. Use instead of describe for current/latest/recent monthly questions."
        },
        "start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inclusive start month/date. Use together with end."
        }
      },
      "type": "object"
    }
  },
  "properties": {
    "format": {
      "enum": [
        "xlsx",
        "csv",
        "json",
        "txt"
      ],
      "type": "string"
    },
    "idempotency_key": {
      "anyOf": [
        {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "MCP paid non-dry-run single operations require idempotency_key; REST and free previews may omit it."
    },
    "query": {
      "$ref": "#/$defs/Schema1"
    },
    "task_query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional task attribution: when provided, write one concise, self-contained task_query in the user's language and reuse that exact value in every call for the task, including discovery, search, approval retry, results, export, and status checks. For MCP calls, when omitted, Asklear records a generic non-user-specific attribution so compatible clients can still call the tool. REST calls may omit it and remain unattributed. It is a task description, not a task identifier. Do not include hidden reasoning, credentials, or direct personal identifiers such as phone numbers, email addresses, identity numbers, or street addresses.",
      "maxLength": 300
    }
  },
  "required": [
    "query",
    "format"
  ],
  "type": "object"
}
```

### Synthetic request / 合成请求

```json
{
  "format": "xlsx",
  "query": {
    "dataset": "douyin",
    "group_by": [
      "brand"
    ],
    "limit": 10,
    "metrics": [
      "gmv"
    ],
    "order_by": [
      {
        "dir": "desc",
        "field": "gmv"
      }
    ],
    "task_query": "查看抖音最近一个完整月的品牌销售额排名",
    "time": {
      "last_complete_months": 1
    }
  }
}
```

### Synthetic response / 合成响应

```json
{
  "job_id": "export-example"
}
```

- job_id (string): 暂无字段说明

Follow up: GET /v1/export/{job_id}
查看导出状态。

## export

legacy · available · api_key, oauth

REST 需要客户 API Key；MCP 需要已开放的服务及现有授权；CLI 需要已发布且包含该命令的客户端。



执行遵循现有计价；读取公开说明不扣 Credits。

请求声明 idempotency_key 时，同一次操作复用原键；元数据 GET 只读。

等待态响应提供结果/状态引用。先读取原结果；超时或结果不明时禁止自动重新提交付费执行。401/403/422 应先修正鉴权、权限或输入。

### Input schema / 输入契约

```json
{
  "$defs": {
    "Schema1": {
      "description": "Metric query shape for asynchronous exports, independent of page size.",
      "properties": {
        "approved_plan_digest": {
          "anyOf": [
            {
              "pattern": "^plan_[0-9a-f]{64}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "dataset": {
          "description": "Dataset ID; use an enabled dataset for the requested native route.",
          "type": "string"
        },
        "dry_run": {
          "default": false,
          "description": "Set true only when the user asks for a price preview.",
          "type": "boolean"
        },
        "filters": {
          "description": "Aligned query scope. Resolve user-supplied brand, shop, and category names with search_values; product/shop URLs are values for product_id/shop_id.",
          "items": {
            "$ref": "#/$defs/Schema3"
          },
          "type": "array"
        },
        "group_by": {
          "description": "Exact public result dimensions. Include month for a monthly trend; for entity results include the declared ID, name, and URL fields.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "limit": {
          "default": 100,
          "maximum": 1000000,
          "minimum": 1,
          "type": "integer"
        },
        "max_credits": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "metrics": {
          "description": "Public metrics requested by the user; do not add unrequested metrics.",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        },
        "order_by": {
          "description": "Sort by a returned metric or groupable dimension.",
          "items": {
            "$ref": "#/$defs/Schema2"
          },
          "type": "array"
        },
        "time": {
          "$ref": "#/$defs/Schema4",
          "description": "Absolute range or last_complete_months; relative time needs no describe."
        }
      },
      "required": [
        "dataset",
        "metrics",
        "time"
      ],
      "type": "object"
    },
    "Schema2": {
      "properties": {
        "dir": {
          "default": "asc",
          "enum": [
            "asc",
            "desc"
          ],
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      },
      "required": [
        "field"
      ],
      "type": "object"
    },
    "Schema3": {
      "properties": {
        "field": {
          "description": "Public dimension used to scope the query.",
          "type": "string"
        },
        "op": {
          "description": "Use eq with one platform raw value already returned by search_values or earlier context; use in with all relevant returned raw values.",
          "enum": [
            "eq",
            "neq",
            "in",
            "not_in",
            "gt",
            "gte",
            "lt",
            "lte",
            "contains",
            "is_unknown",
            "is_known"
          ],
          "type": "string"
        },
        "value": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Single operand for eq, neq, comparisons, or contains."
        },
        "values": {
          "anyOf": [
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Platform raw values used by in or not_in."
        }
      },
      "required": [
        "field",
        "op"
      ],
      "type": "object"
    },
    "Schema4": {
      "properties": {
        "end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inclusive end month/date. Use together with start."
        },
        "grain": {
          "const": "month",
          "default": "month",
          "type": "string"
        },
        "last_complete_months": {
          "anyOf": [
            {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Server-resolved latest complete months ending at the authenticated data-through month. Use instead of describe for current/latest/recent monthly questions."
        },
        "start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inclusive start month/date. Use together with end."
        }
      },
      "type": "object"
    }
  },
  "properties": {
    "format": {
      "enum": [
        "xlsx",
        "csv",
        "json",
        "txt"
      ],
      "type": "string"
    },
    "idempotency_key": {
      "anyOf": [
        {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "MCP paid non-dry-run single operations require idempotency_key; REST and free previews may omit it."
    },
    "query": {
      "$ref": "#/$defs/Schema1"
    },
    "task_query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional task attribution: when provided, write one concise, self-contained task_query in the user's language and reuse that exact value in every call for the task, including discovery, search, approval retry, results, export, and status checks. For MCP calls, when omitted, Asklear records a generic non-user-specific attribution so compatible clients can still call the tool. REST calls may omit it and remain unattributed. It is a task description, not a task identifier. Do not include hidden reasoning, credentials, or direct personal identifiers such as phone numbers, email addresses, identity numbers, or street addresses.",
      "maxLength": 300
    }
  },
  "required": [
    "query",
    "format"
  ],
  "type": "object"
}
```

### Synthetic request / 合成请求

```json
{
  "format": "xlsx",
  "query": {
    "dataset": "douyin",
    "group_by": [
      "brand"
    ],
    "limit": 10,
    "metrics": [
      "gmv"
    ],
    "order_by": [
      {
        "dir": "desc",
        "field": "gmv"
      }
    ],
    "task_query": "查看抖音最近一个完整月的品牌销售额排名",
    "time": {
      "last_complete_months": 1
    }
  }
}
```

### Synthetic response / 合成响应

```json
{
  "job_id": "export-example"
}
```

- job_id (string): 暂无字段说明

Follow up: GET /v1/export/{job_id}
查看导出状态。

## asklear export

legacy · available · api_key, oauth

REST 需要客户 API Key；MCP 需要已开放的服务及现有授权；CLI 需要已发布且包含该命令的客户端。



执行遵循现有计价；读取公开说明不扣 Credits。

请求声明 idempotency_key 时，同一次操作复用原键；元数据 GET 只读。

等待态响应提供结果/状态引用。先读取原结果；超时或结果不明时禁止自动重新提交付费执行。401/403/422 应先修正鉴权、权限或输入。

### Input schema / 输入契约

```json
{
  "$defs": {
    "Schema1": {
      "description": "Metric query shape for asynchronous exports, independent of page size.",
      "properties": {
        "approved_plan_digest": {
          "anyOf": [
            {
              "pattern": "^plan_[0-9a-f]{64}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "dataset": {
          "description": "Dataset ID; use an enabled dataset for the requested native route.",
          "type": "string"
        },
        "dry_run": {
          "default": false,
          "description": "Set true only when the user asks for a price preview.",
          "type": "boolean"
        },
        "filters": {
          "description": "Aligned query scope. Resolve user-supplied brand, shop, and category names with search_values; product/shop URLs are values for product_id/shop_id.",
          "items": {
            "$ref": "#/$defs/Schema3"
          },
          "type": "array"
        },
        "group_by": {
          "description": "Exact public result dimensions. Include month for a monthly trend; for entity results include the declared ID, name, and URL fields.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "limit": {
          "default": 100,
          "maximum": 1000000,
          "minimum": 1,
          "type": "integer"
        },
        "max_credits": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "metrics": {
          "description": "Public metrics requested by the user; do not add unrequested metrics.",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        },
        "order_by": {
          "description": "Sort by a returned metric or groupable dimension.",
          "items": {
            "$ref": "#/$defs/Schema2"
          },
          "type": "array"
        },
        "time": {
          "$ref": "#/$defs/Schema4",
          "description": "Absolute range or last_complete_months; relative time needs no describe."
        }
      },
      "required": [
        "dataset",
        "metrics",
        "time"
      ],
      "type": "object"
    },
    "Schema2": {
      "properties": {
        "dir": {
          "default": "asc",
          "enum": [
            "asc",
            "desc"
          ],
          "type": "string"
        },
        "field": {
          "type": "string"
        }
      },
      "required": [
        "field"
      ],
      "type": "object"
    },
    "Schema3": {
      "properties": {
        "field": {
          "description": "Public dimension used to scope the query.",
          "type": "string"
        },
        "op": {
          "description": "Use eq with one platform raw value already returned by search_values or earlier context; use in with all relevant returned raw values.",
          "enum": [
            "eq",
            "neq",
            "in",
            "not_in",
            "gt",
            "gte",
            "lt",
            "lte",
            "contains",
            "is_unknown",
            "is_known"
          ],
          "type": "string"
        },
        "value": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Single operand for eq, neq, comparisons, or contains."
        },
        "values": {
          "anyOf": [
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Platform raw values used by in or not_in."
        }
      },
      "required": [
        "field",
        "op"
      ],
      "type": "object"
    },
    "Schema4": {
      "properties": {
        "end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inclusive end month/date. Use together with start."
        },
        "grain": {
          "const": "month",
          "default": "month",
          "type": "string"
        },
        "last_complete_months": {
          "anyOf": [
            {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Server-resolved latest complete months ending at the authenticated data-through month. Use instead of describe for current/latest/recent monthly questions."
        },
        "start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inclusive start month/date. Use together with end."
        }
      },
      "type": "object"
    }
  },
  "properties": {
    "format": {
      "enum": [
        "xlsx",
        "csv",
        "json",
        "txt"
      ],
      "type": "string"
    },
    "idempotency_key": {
      "anyOf": [
        {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "MCP paid non-dry-run single operations require idempotency_key; REST and free previews may omit it."
    },
    "query": {
      "$ref": "#/$defs/Schema1"
    },
    "task_query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional task attribution: when provided, write one concise, self-contained task_query in the user's language and reuse that exact value in every call for the task, including discovery, search, approval retry, results, export, and status checks. For MCP calls, when omitted, Asklear records a generic non-user-specific attribution so compatible clients can still call the tool. REST calls may omit it and remain unattributed. It is a task description, not a task identifier. Do not include hidden reasoning, credentials, or direct personal identifiers such as phone numbers, email addresses, identity numbers, or street addresses.",
      "maxLength": 300
    }
  },
  "required": [
    "query",
    "format"
  ],
  "type": "object"
}
```

### Synthetic request / 合成请求

```json
{
  "format": "xlsx",
  "query": {
    "dataset": "douyin",
    "group_by": [
      "brand"
    ],
    "limit": 10,
    "metrics": [
      "gmv"
    ],
    "order_by": [
      {
        "dir": "desc",
        "field": "gmv"
      }
    ],
    "task_query": "查看抖音最近一个完整月的品牌销售额排名",
    "time": {
      "last_complete_months": 1
    }
  }
}
```

### Synthetic response / 合成响应

```json
{
  "job_id": "export-example"
}
```

- job_id (string): 暂无字段说明

Follow up: GET /v1/export/{job_id}
查看导出状态。

