# Medicine Simplifier (`ashutosht05/medicine-simplifier`) Actor

AI Medical Translator & Simplifier. Instantly converts complex drug leaflets, dosage instructions, and safety warnings into clear, multilingual patient guides.

- **URL**: https://apify.com/ashutosht05/medicine-simplifier.md
- **Developed by:** [Ashutosh Kumar Tiwari](https://apify.com/ashutosht05) (community)
- **Categories:** Integrations, Other, AI
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 4.00 out of 5 stars

## Pricing

from $0.0001 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Medicine Simplifier

> **Bridging the gap between complex medical jargon and patient safety—in any language.**

[![Apify](https://img.shields.io/badge/Apify-Actor-orange?style=for-the-badge\&logo=apify)](https://apify.com)
[![Powered By](https://img.shields.io/badge/Powered%20By-Lingo.dev%20%2B%20Gemini-blue?style=for-the-badge)](https://lingo.dev)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)

<br>

### What is this?

The **Medicine Simplifier** is an AI-powered Apify Actor designed to prevent medication errors among non-native speakers, the elderly, and travelers.

It takes a medicine name (in **any** language/script) and returns a simple, bulleted safety guide in the patient's native language.

#### ***Always consult your doctor first, before taking any medicine!***

<br>

#### Key Features

- **Universal Input:** Accepts medicine names written in most common languages and scripts. (e.g., `ロキソプロフェン`, `Doliprane`, `Paracetamol`).
- **Hybrid AI Engine:**
  - **Gemini 2.5 Flash:** Normalizes foreign drug names, performs deep analysis, and summarizes complex text.
  - **Lingo.dev:** Provides highly accurate, localized translations of the final instructions.
- **Transparent Sources:** Returns the direct URL to the medical data source used, ensuring trust and verifiability.
- **Phonetic Pronunciation (FR/DE/ES):** Adds human-readable phonetic guidance for medicine names where helpful.
- **Automatic Safety Flags:** Instantly detects critical risks like:
  - Take with food
  - Avoid alcohol
  - Pregnancy risks
  - Drowsiness warnings
- **Fault Tolerant:** Includes robust error reporting. If one part fails (e.g., translation), the actor still delivers the partial data it successfully retrieved.

<br>

### How It Works

1. **Input:** User enters a medicine name (e.g., "バファリン") and target language (e.g., "Hindi").
2. **Normalization:** Gemini identifies the standard English generic name (e.g., "Aspirin").
3. **Search Scan:** The Actor searches trusted public medical databases (e.g., Drugs.com).
4. **Summarization:** Gemini extracts dosage and safety info, formatting it into a clean list.
5. **Localization:** Lingo.dev translates the summary and the medicine name back into the target language.

<br>

### Input Parameters

| Field | Type | Description | Default |
|-------|------|-------------|----------|
| `medicine_name` | `str` | The name of the medicine in ANY language (generic names preferred for best accuracy). | `Doliprane` |
| `target_language` | `str` | The language for the output instructions (English, French, Hindi, Japanese, etc.). | `English` |
| `gemini_api_key` | `str` | Your Google Gemini API Key (Free tier available). | `Required` |
| `lingo_api_key` | `str` | Your Lingo.dev API Key. | `Required` |

<br>

### Current language support:

| Language | ISO 639-1 Code |
|----------|----------------|
| English | `en` |
| Spanish | `es` |
| French | `fr` |
| German| `de` |
| Japanese | `ja` |
| Chinese | `zh` |
| Hindi | `hi` |

<br>

### How to Use?

#### Step 1: Get your API keys:

1. Visit [Lingo.dev](https://lingo.dev/) and [Gemini API Key](https://studio.google.com/api-keys)
2. Sign up/ Sign in
3. Go to Developer Dashboard and get your API Keys

#### Step 2: Translation

1. Enter your medicine name
2. Select your desired language
3. Enter your Gemini API Key
4. Enter your Lingo.dev API Key

#### Step 3: Run!

- Run the actor and receive instructions in your desired language.

<br>

### Sample Output (JSON)

Here is an example of a Japanese user searching for **"Advil"** (Ibuprofen):

```json
{
  "input_medicine": "Advil",
  "medicine_translated": "イブプロフェン",
  "patient_language": "Japanese",
  "translated_instructions": [
    "痛みや熱のために必要に応じて4〜6時間ごとに1錠（200mg）を服用してください。",
    "胃の不調を防ぐために、食べ物や牛乳と一緒に服用してください。",
    "医師の指示がない限り、24時間以内に6錠（1200mg）を超えて服用しないでください。",
    "アスピリンや他のNSAIDにアレルギーがある場合は使用しないでください。"
  ],
  "important_disclaimer": "免責事項：AIは誤る可能性があります。医師に相談してください.",
  "safety_flags": {
    "take_with_food": true,
    "avoid_alcohol": true,
    "may_cause_drowsiness": false,
    "pregnancy_warning": true
  },
  "source_url": "[https://www.drugs.com/advil.html](https://www.drugs.com/advil.html)",
  "error_report": []
}
```

<br>

### Use Cases:

1. **Simplifies complex medical data:** Converts dense technical text from Drugs.com into five clear, easy-to-understand dosage steps for patients.

2. **Overcomes language barriers:** Uses Lingo.dev to accurately localize medicine names (translation or transliteration as appropriate) and translate instructions into languages like Hindi or Japanese.

3. **Identifies critical risks:** Automatically extracts and flags vital safety warnings like alcohol restrictions or pregnancy hazards via Gemini.

4. **Enables health tech integration:** Delivers structured, verified JSON data for developers building telemedicine apps, chatbots, or digital pill dispensers.

<br>

### Limitations

- Information is sourced from publicly available medical databases and may vary by country.
- Dosage recommendations are general and not personalized.
- The actor does not replace professional medical advice.

<br>

### Disclaimer:

Please use generic medicine names when searching to ensure the most accurate results. Brand names may lead to mismatched or incomplete instructions, as the database primarily indexes medications under their generic names rather than brand names.

However, the system will still attempt to retrieve relevant information by also searching for the corresponding brand name.

***

<center> Powered by <a href = "https://lingo.dev/">Lingo.dev</a> & <a href = "https://apify.com/">Apify</a>  </center>

# Actor input Schema

## `medicine_name` (type: `string`):

Enter the medicine name (generic preferred, any language or script supported, e.g. Paracetamol, ドルプラン, Doliprane).

## `target_lang` (type: `string`):

Select the language for the translated instructions.

## `gemini_api_key` (type: `string`):

API Key for Google Gemini (used for analysis and summarization).

## `lingo_api_key` (type: `string`):

API Key for Lingo.dev (used for translation and localization).

## Actor input object example

```json
{
  "medicine_name": "Doliprane",
  "target_lang": "en"
}
```

# Actor output Schema

## `patient_guide` (type: `string`):

View the simplified instructions and safety warnings in the target language.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ashutosht05/medicine-simplifier").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("ashutosht05/medicine-simplifier").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call ashutosht05/medicine-simplifier --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ashutosht05/medicine-simplifier"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7w7YNXQA7hfVpwj3j/builds/EsjPR363MbM2XffE7/openapi.json
