HTTP接入

更新时间:
复制 MD 格式

基于 API-KEY 的 HTTP 直接调用方式。

获取 API_KEY

登录阿里云CleverSee/IQS的控制台:获取API Key

使用方式:HTTP Header: Authorization: Bearer <API-KEY>

联网搜索API

极速版(Lite)

使用“engineType =CNLiteBasic”传参,示例如下:

curl  -X POST https://cloud-iqs.aliyuncs.com/search/unified \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "query": "杭州美食",
  "engineType": "CNLiteBasic",
  "contents": {
    "mainText": true,
    "markdownText":false,
    "summary": false,
    "rerankScore": true
  },
  "advancedParams":{
    "numResults": 5
  }
}'
智能版(Auto)

使用“engineType =CNAuto”传参,示例如下:

curl  -X POST https://cloud-iqs.aliyuncs.com/search/unified \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "query": "杭州美食",
  "engineType": "CNAuto",
  "contents": {
    "mainText": true,
    "markdownText":false,
    "summary": false,
    "rerankScore": true
  },
  "advancedParams":{
    "numResults": 5
  }
}'
Generic版

使用“engineType =Generic”传参,如果需要50条返回结果,需要使用“engineType =GenericAdvanced”传参(请注意 联网搜索计费说明)示例如下:

curl  -X POST https://cloud-iqs.aliyuncs.com/search/unified \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "query": "杭州美食",
  "engineType": "Generic",
  "contents": {
    "mainText": true,
    "markdownText":false,
    "summary": false,
    "rerankScore": false
  },
  "advancedParams":{
    "numResults": 5
  }
}'

联网多模态(图搜)

curl  -X POST https://cloud-iqs.aliyuncs.com/search/multimodal \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "query": "狮子"
}'

联网问答Agent

curl -X POST 'https://cloud-iqs.aliyuncs.com/qa/chat' \
  -H 'X-API-Key: <YOUR-API-KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "appId": "your_app_id",
  "sessionId": "your_session_id",
  "message": {
    "role": "user",
    "parts": [
      {
        "type": "text",
        "text": "今天北京天气怎么样"
      }
    ]
  },
  "stream": true
}'

网页解析 ReadPage

标准版
curl --location 'https://cloud-iqs.aliyuncs.com/readpage/basic' \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://help.aliyun.com/document_detail/2837301.html",
    "maxAge": 0
}'
增强版

使用浏览器动态渲染读取网页,RT较高。

curl --location 'https://cloud-iqs.aliyuncs.com/readpage/scrape' \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://help.aliyun.com/document_detail/2837301.html",
    "maxAge": 0
}'

垂域查询 Vertical

周边查询

该产品规格不支持使用HTTP接入。

医疗问答

curl  -X POST https://cloud-iqs.aliyuncs.com/medical/answer \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "query": "肚子疼怎么办"
}'

健康图谱

curl  -X POST https://cloud-iqs.aliyuncs.com/medical/know \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "query": "阿莫⻄林胶囊",
  "type": "medicine"
}'