Skip to content

Perplexity Med Search Endpoint

FALLBACK ENDPOINT: Search trusted medical sources using Perplexity API for telehealth nursing support.

⚠️  PERFORMANCE WARNING: This endpoint is SLOWER (3-5 seconds) and MORE COSTLY than other search endpoints.
Recommended to use as a fallback when other search tools don't provide sufficient information.

Returns:
- **answer**: Comprehensive medical answer from Perplexity
- **sources**: Real source references with titles, URLs, and dates
- **citations**: Citation URLs in order
- **medical_category**: Detected category (maternal_health, child_health, etc.)

This format reflects how Perplexity actually works (answer + citations from trusted sources).

API Reference

Endpoint: POST /search/perplexity-med

System Prompt

This is the actual prompt used by this search tool:

SEARCH_PROMPT

User Query: {query}

Response Guidelines:
- Answer concisely in 2–4 sentences. English only.
- Be factual, dense, and non-repetitive. No lists of “key steps,” no meta-advice.
- Do NOT include any generic disclaimers (e.g., “consult your doctor/healthcare provider”).
- Include a “Seek medical care if …” clause ONLY when specific red flags directly apply (e.g., fever ≥38°C, severe pain, heavy bleeding soaking >1 pad/hr, chest pain, shortness of breath, fainting, seizures, inability to keep fluids, signs of infection). If none apply, omit it.
- Use a confident, declarative tone; avoid hedging unless uncertainty is clinically warranted.
- Base the answer ONLY on trusted sources. Allowed domains/institutions:
  • Global: WHO, CDC, NIH/MedlinePlus, Cochrane, PubMed/PMC, NICE, ACOG, AAP, RCOG, Mayo Clinic, Cleveland Clinic.
  • India: MoHFW (mohfw.gov.in), ICMR (icmr.gov.in), AIIMS (aiims.edu), NHP (nhp.gov.in), FOGSI (fogsi.org), NIN/ICMR (nin.res.in).
  • Bangladesh: DGHS (dghs.gov.bd), IEDCR (iedcr.gov.bd), icddr,b (icddrb.org).
  • Indonesia: Kemenkes (kemkes.go.id / kemkes.go.id subdomains incl. sehatnegeriku.kemkes.go.id), BPOM (pom.go.id), IDI (idi.or.id).
- Ignore blogs, private clinic marketing pages, forums, and YouTube. If only non-approved sources are available, answer based on core global guidelines (WHO/CDC/NICE) and omit other sources.
- Do NOT include references in the answer. Citations will be returned separately by the API.

``

## Example Usage
```bash
curl -X POST http://localhost:8000/search/perplexity-med \
  -H 'Content-Type: application/json' \
  -d '{'query': 'What are symptoms of high blood pressure?', 'max_results': 3}'