HTTP access

Updated at:

Use an API key to make direct HTTP calls.

Get your API key

Log on to the Alibaba Cloud CleverSee/IQS console to get your API key.

To authenticate your requests, pass the API key in the Authorization header: Authorization: Bearer <YOUR_API_KEY>

Web search API

Lite

Set the engineType parameter to CNLiteBasic.

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

Set the engineType parameter to CNAuto.

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

Set the engineType parameter to Generic. To receive 50 results, you must set engineType to GenericAdvanced (see Web Search Pricing).

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

Multimodal search

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

Web q and a agent

curl -X POST https://cloud-iqs.aliyuncs.com/qa/chat \
  --header "Authorization: Bearer <YOUR-API-KEY>" \
  --header "Content-Type: application/json" \
  --data '{
  "appId": "your_app_id",
  "sessionId": "your_session_id",
  "message": {
    "role": "user",
    "parts": [
      {
        "type": "text",
        "text": "What is the weather like in Beijing today?"
      }
    ]
  },
  "stream": true
}'

Readpage

Standard
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
}'
Enhanced

This version reads web pages using dynamic browser rendering, which may increase response time.

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 search

Nearby search

This edition does not support HTTP access.

Medical q and a

curl  -X POST https://cloud-iqs.aliyuncs.com/medical/answer \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "query": "What should I do if I have a stomachache?"
}'

Health knowledge graph

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