Suggest medicine names
GET/v1/drugs/suggestions
Returns distinct names from every source for typeahead. Exact names sort first, then names starting with the query, then other matches, shorter names first. Debounce requests and ignore stale responses when the query changes.
Parameters
-
countrystring Required - Two-letter ISO 3166-1 country code, lowercase. Every search is scoped to one country.
-
qstring Required - What the user has typed so far, at least 3 characters.
-
limitinteger - Number of suggestions to return, from 1 to 10. Defaults to 8.
-
useDomainenum -
Keep only records whose source classifies them for this use. human and veterinary also include products the source marks for both. Applied before pagination.
Possible values:
humanveterinarybothunknownnot-applicable -
speciesstring - Keep only records with this reviewed target species, such as dog, cat, horse or cattle. Records with unknown or unmapped species are excluded. Applied before pagination.
Returns
-
countrystring - The country searched.
-
suggestionsstring[] - Distinct names, best matches first.
Errors
400 401
403
429 503 ·
Errors and rate limits
curl -G https://api.medifontis.com/v1/drugs/suggestions \
-H "Authorization: Bearer $MEDIFONTIS_API_KEY" \
--data-urlencode "country=it" \
--data-urlencode "q=tach" \
--data-urlencode "limit=8"const params = new URLSearchParams({ country: 'it', q: 'tach', limit: '8' })
const response = await fetch(`https://api.medifontis.com/v1/drugs/suggestions?${params}`, {
headers: { Authorization: `Bearer ${process.env.MEDIFONTIS_API_KEY}` },
})
if (!response.ok) throw new Error(`Medifontis ${response.status}`)
const { suggestions } = await response.json()import os
import requests
response = requests.get(
"https://api.medifontis.com/v1/drugs/suggestions",
params={"country": "it", "q": "tach", "limit": "8"},
headers={"Authorization": f"Bearer {os.environ['MEDIFONTIS_API_KEY']}"},
timeout=10,
)
response.raise_for_status()
suggestions = response.json()["suggestions"]
{
"country": "it",
"suggestions": [
"TACHICAF",
"TACHIDOL",
"TACHOSIL",
"TACHIFENE",
"TACHIVERDE"
]
}