CleverSee - Vertical Search Medical Q&A API
Call the MedicalAnswer API to get professional answers and their sources based on authoritative medical data.
Overview
API name: MedicalAnswer
This API searches authoritative medical data and uses a large model to summarize and refine the findings into comprehensive, professional answers. The results are more comprehensive and professional than those from standard search engines. The API can also answer a wide range of conversational questions, such as "Why do I get nauseous in cars?", "What should I do for a stomach ache?", or "Is diet soda good for you?".
The metering method is Internet Search (Generic Edition). The unit price varies by daily usage tier. For more information about the pricing tiers, see Vertical Query - Billing.
The server-side timeout is 5 seconds.
Medical and health-related content is for informational purposes only. It does not constitute medical advice and is not a substitute for an in-person diagnosis and prescription from a licensed physician.
API reference
Request parameters
Parameter | Type | Required | Default | Description | Example |
query | string | Yes | - | The search query. The value must be 1 to 200 characters long. For best results, keep the query under 30 characters. You can use a model on the client side to rewrite the query before calling the API. | What to do for a stomach ache? |
Client-side validation for length and required fields is recommended. If the query is missing or is an empty string, the API returns an HTTP 200 status code with an empty messages array instead of an error code. If the query exceeds 200 characters, the API does not return an error, but result quality is not guaranteed.
Response parameters
Field | Type | Nullable | Description | Example |
requestId | string | No | The request ID. Provide this ID when troubleshooting. | 35E5608A-A737-2038-****-D9D34C6BFD9E |
messages | list | Yes | A list of answers. If the | See the example below. |
messages[].content | string | No | The professional answer, summarized and refined by the large model. The | There are many causes of stomach aches. Relief methods depend on the specific cause and severity... |
messages[].metaData.raDocList | list | Yes | A list of cited sources. The API may return an empty array for abnormal or excessively long queries. | See the example below. |
messages[].metaData.raDocList[].title | string | No | Base the format on the source title. For sources such as literature, books, and guides, enclose the title in book title marks ( | How to quickly and easily stop a stomach ache |
messages[].metaData.raDocList[].rawUrl | string | Yes | The URL of the cited source. This field is an empty string for sources such as research papers, clinical guidelines, and books. | https://www.example.com/article/4CD364Mm8hh.html |
messages[].metaData.raDocList[].content | string | Yes | An excerpt of the cited source's content. The API returns an excerpt only for sources such as medical web pages and drug instructions. This field is an empty string for sources such as publications and knowledge bases. | A stomach ache can be caused by various factors, including gastrointestinal spasms and inflammation... |
messages[].metaData.raDocList[].type | string | No | The type of the cited source. Possible values: | med_web_source |
searchInformation.searchTime | int64 | No | The search duration, in milliseconds. | 342 |
queryContext.originalQuery.query | string | Yes | An echo of the original | What to do for a stomach ache? |
Examples
Request body
{
"query": "What to do for a stomach ache?"
}Response
{
"requestId": "ea42f9********1fa8",
"messages": [
{
"content": "There are many reasons for a stomach ache, and relief methods depend on the specific cause and severity. Here are some common relief measures: 1. **Temporarily stop eating**: If the abdominal pain is caused by diet (such as overeating or consuming spicy, greasy food), you can pause eating to let your digestive system rest and avoid further irritation[3][7]. 2. **Apply heat or massage the abdomen**: This is suitable for mild abdominal pain, such as cramps due to cold or minor indigestion.",
"metaData": {
"raDocList": [
{
"title": "《How to Effectively Relieve Acute Abdominal Pain》",
"rawUrl": "",
"content": "",
"type": "paper_source"
},
{
"title": "How to relieve a stomach ache simply and quickly",
"rawUrl": "https://www.example.com/article/4CD364Mm8hh.html",
"content": "A stomach ache can be caused by various reasons, including gastrointestinal spasms, inflammation, urinary system stones, and menstrual pain. It can be treated by applying abdominal heat or taking pain medication.",
"type": "med_web_source"
},
{
"title": "《Primary Care Guideline for Peptic Ulcer (2023) Treatment》",
"rawUrl": "",
"content": "",
"type": "guide_source"
},
{
"title": "《Common Symptoms Section 15: Abdominal Pain》",
"rawUrl": "",
"content": "",
"type": "book_source"
}
],
"mimeType": null
}
}
],
"searchInformation": {
"searchTime": 342
},
"queryContext": {
"originalQuery": {
"query": "What to do for a stomach ache?"
}
}
}Call the API
Authenticate requests with your API key. You can create an API key in the console under "Create/View Credential Key". A new API key takes about 5 minutes to become active.
curl -X POST https://cloud-iqs.aliyuncs.com/medical/answer \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"query": "What to do for a stomach ache?"
}'This API supports only direct HTTP calls and is not available through an Alibaba Cloud OpenAPI SDK. For MCP or Skill integration methods, see the "Integration Methods" section.
Error codes
Failed calls return a non-2xx HTTP status code and a flat response body. The errorCode and errorMessage are always returned. Some errors may also include code and message fields with the same meaning. When parsing the response, use errorCode as the definitive source.
{
"errorCode": "Retrieval.EngineNotActivate",
"errorMessage": "Please activate medicalKnowSearch.",
"code": "Retrieval.EngineNotActivate",
"message": "Please activate medicalKnowSearch."
}Status code | Error code | Error message | Solution |
403 | Retrieval.InvalidAPIKey | Incorrect API key provided. | Check that the Authorization header is in the |
403 | Retrieval.EngineNotActivate | Please activate xxx. | The search engine for this API has not been activated for your credentials. Contact your account manager for activation. |
403 | Retrieval.NotActivate | Please activate AI search service | Place an order or contact your account manager to activate the service. |
403 | Retrieval.Arrears | Please recharge first. | Your account has an insufficient balance. Add funds to your account. |
403 | Retrieval.NotAuthorised | Please authorize the AliyunIQSFullAccess privilege to the sub-account. | The sub-account is not authorized. For more information, see "Create a RAM User and Grant Permissions". |
403 | Retrieval.TestUserPeriodExpired | The test period has expired. | Your trial has expired (valid for 15 days after you place the order). Contact your account manager to switch to a paid plan. |
429 | Retrieval.Throttling.User | Request was denied due to user-level throttling. | You have exceeded the throttling limit. Contact your account manager to upgrade your service plan. |
429 | Retrieval.TestUserQueryExceeded | Query limit exceeded. | The daily query limit for the trial has been exceeded (1,000 calls/day). Contact your account manager to switch to a paid plan. |