Alternative search endpoint for MedlinePlus health topics. Functions similarly to /ws/query, returning XML with health topic information.
This endpoint appears to provide the same functionality as /ws/query. Use either endpoint for health topic searches — they return similar XML structures with:
- Search term metadata
- Total count of results
- Paginated list of documents with titles, summaries, and URLs
The response is ideal for building health information search features where users can discover relevant MedlinePlus articles by keyword.
From spec: Search for health topics in MedlinePlus. Returns XML with matching documents including titles, summaries, MeSH terms, and group classifications. Supports field-specific searches (title, mesh, full-summary, group).
Usage Tips
- **Requires `db` parameter**: Set to `healthTopics` or `healthTopicsSpanish`
- **Query syntax**: Supports Boolean operators (+AND+, +OR+) and phrase searching with %22
- **Field qualifiers**: Use `title:`, `altTitle:`, or `FullSummary:` to search specific fields
- **Pagination**: Control results with `retstart` (offset) and `retmax` (limit)
- **Response is XML**: Parse as XML regardless of the content type header nuances
import zingu_apis
api = zingu_apis.api("medlineplus")
result = api.fetch("query", db="healthTopics", term="asthma", retmax=10, rettype="all")
for item in result:
print(item)
const resp = await fetch("https://api.nlm.nih.gov/lit/ctxp/v1/query?db=healthTopics&term=asthma&retmax=10&rettype=all");
const data = await resp.json();