The MedicalKnow API, powered by authoritative medical data, supports both attribute queries and clustering queries on medical subjects. For example, you can ask "Which is the best dental hospital in China (Hangzhou)?", "What are the calories in an apple?", or "What is aspirin?". MedicalKnow provides more comprehensive medical information than typical search APIs.
API definition
Request parameters
Parameter | Type | Required | Default | Description | Example | |
query | string | Yes | - | The search query. Must be 1 to 200 characters long. Important For best results, limit the query to 30 characters. You can use a client-side model to rewrite the query before calling the API. | Amoxicillin capsules | |
type | string | Yes | - |
| medicine | |
Response parameters
Field | Type | Nullable | Description | Example | ||||
requestId | string | No | The request ID. Include this ID when submitting a ticket to troubleshoot an issue. | 35E5608A-A737-2038-****-D9D34C6BFD9E | ||||
messages[] | content | string | No | The response content. | Entity: Amoxicillin capsules\n- Attribute[Precise active ingredient]: Amoxicillin\n- Attribute[Dosage form]: Oral capsules\n- Attribute[Indications]: # What diseases can Amoxicillin capsules treat?\nAmoxicillin is a penicillin-class antibiotic with a strong bactericidal effect. In addition to the gram-positive bacteria that regular penicillin can combat, it also fights against gram-negative bacteria such as Escherichia coli and Haemophilus influenzae. However, it is not effective against infectious diseases caused by viruses (such as viral influenza). Amoxicillin has a wide range of indications and is often used to treat infectious diseases caused by sensitive bacteria (non-β-lactamase-producing strains). | |||
url | string | No | A URL with more details. | |||||
searchInformation | searchTime | int64 | No | The search duration in milliseconds. | 500 | |||
queryContext | originalQuery | query | string | No | The original query. | Amoxicillin capsules | ||
The server-side timeout is 5 seconds.
Example
Request body
{
"query": "Amoxicillin capsules",
"type": "medicine"
}Response
{
"requestId": "d3c1b3*********cdebe",
"messages": [
{
"url": "https://p.quark.cn/0387f345/index?uc_biz_str=OPT%3ABACK_BTN_STYLE%400%7COPT%3AIMMERSIVE%401&uc_param_str=dnntnwvepffrbijbprsvchgputdemennosstodcaaapcgidsdieinipixsnxkp&struct_id=VdB%2BLV7w7lHHEp%2Fo7ZfF0JJSD5VX%2Fhou2cPHhOUO%2Bm6cU%2FnGHYBudAnri5Dw6HhY&struct_type=VdB%2BLV7w7lHHEp%2Fo7ZfF0GaP%2FJb5sTdrBuS6EwD3gWU%3D&token=917796353976&version=v1&skip_cache=0&chid=0uhUNr1UmD",
"content": "Entity: Amoxicillin capsules\n- Attribute[Precise active ingredient]: Amoxicillin\n- Attribute[Dosage form]: Oral capsules\n- Attribute[Indications]: # What diseases can Amoxicillin capsules treat?\nAmoxicillin is a penicillin-class antibiotic with a strong bactericidal effect. In addition to the gram-positive bacteria that regular penicillin can combat, it also fights against gram-negative bacteria such as Escherichia coli and Haemophilus influenzae. However, it is not effective against infectious diseases caused by viruses (such as viral influenza). Amoxicillin has a wide range of indications and is often used to treat infectious diseases caused by sensitive bacteria (non-β-lactamase-producing strains):\n- Attribute[Pharmacological action]: Amoxicillin is a penicillin-class antibiotic with good antibacterial activity against aerobic gram-positive cocci such as Streptococcus pneumoniae, Streptococcus pyogenes, non-penicillinase-producing Staphylococcus, and Enterococcus faecalis, as well as non-β-lactamase-producing strains of aerobic gram-negative bacteria such as Escherichia coli, Salmonella, Haemophilus influenzae, Neisseria gonorrhoeae, and Helicobacter pylori.\nAmoxicillin exerts its bactericidal effect by inhibiting bacterial cell wall synthesis, which causes the bacteria to rapidly become spherical and then lyse and rupture."
}
],
"searchInformation": {
"searchTime": 308
},
"queryContext": {
"originalQuery": {
"query": "Amoxicillin capsules"
}
}
}Error codes
Status | Error code | Error message | Solution |
404 | InvalidAccessKeyId.NotFound | The specified access key is not found. | Ensure that your AccessKey ID and AccessKey Secret are correct. |
403 | Retrieval.NotActivate | Please activate AI search service | To activate the service, place an order or contact your account manager. |
403 | Retrieval.Arrears | Please recharge first. | Your account balance is insufficient. Please top up your account. |
403 | Retrieval.NotAuthorised | Please authorize the AliyunIQSFullAccess privilege to the sub-account. | The sub-account does not have the required permissions. For more information, see Create a RAM user and grant permissions. |
403 | Retrieval.TestUserPeriodExpired | The trial period has expired. | Your trial period has expired. The trial is valid for 15 days from the date of your order. Contact your account manager to switch to the paid service. |
429 | Retrieval.Throttling.User | Request was denied due to user flow control. | The request rate exceeds the specified limit. Contact your account manager to upgrade your plan. |
429 | Retrieval.TestUserQueryExceeded | The query exceeds the limit | The daily query limit for the trial period (1,000 queries/day) has been exceeded. Contact your account manager to switch to the paid service. |
API calls
HTTP call
Use an API-KEY from the Information Query Service (IQS) to authenticate API calls over HTTP. To obtain an API-KEY, see Create and view a credential key.
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"
}'
Replace $API_KEY with the API-KEY that you created in the Information Query Service (IQS) console. For more information, see Create and view a credential key. The API-KEY takes about 5 minutes to become effective.
MCP call
For information about MCP access, see MCP Access.