You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
What is Indometacin and explain in detail?
Indometacin, also known as indomethacin, is a nonsteroidal anti-inflammatory drug (NSAID) commonly used as a prescription medication to reduce fever, pain, stiffness, and swelling from inflammation. It works by inhibiting the production of prostaglandins, endogenous signaling molecules known to cause these symptoms. It does this by inhibiting cyclooxygenase, an enzyme that catalyzes the production of prostaglandins.It was patented in 1961 and approved for medical use in 1963. It is on the World Health Organizations List of Essential Medicines. It is marketed under more than twelve different trade names. In 2017, it was the 291st most commonly prescribed medication in the United States, with more than one million prescriptions.

Medical uses
As an NSAID, indometacin is an analgesic, anti-inflammatory, and antipyretic. Clinical indications for indometacin include:Joint diseases

rheumatoid arthritis
ankylosing spondylitis
osteoarthritis
gouty arthritis
acute painful shoulder bursitis or tendinitisHeadaches

Trigeminal autonomic cephalgias
Paroxysmal hemicranias
Chronic paroxysmal hemicrania
Episodic paroxysmal hemicrania
Hemicrania continua
Valsalva-induced headaches
Primary cough headache
Primary exertional headache
Primary headache associated with sexual activity (preorgasmic and orgasmic)
Primary stabbing headache (jabs and jolts syndrome)
Hypnic headacheOthers

Patent ductus arteriosus

Contraindications
Concurrent peptic ulcer, or history of ulcer disease
Allergy to indometacin, aspirin, or other NSAIDs
Roux-en-Y gastric bypass and gastric sleeve patients
Patients with nasal polyps reacting with an angioedema to other NSAIDs
Children under 2 years of age (with the exception of neonates with patent ductus arteriosus)
Severe pre-existing renal and liver damage
Caution: pre-existing bone marrow damage (frequent blood cell counts are indicated)
Caution: bleeding tendencies of unknown origin (indometacin inhibits platelet aggregation)
Caution: Parkinsons disease, epilepsy, psychotic disorders (indometacin may worsen these conditions)
Concurrent with potassium sparing diuretics
Patients who have a patent ductus arteriosus dependent heart defect (such as transposition of the great vessels)
Significant hypertension (high blood pressure)
Concomitant administration of lithium salts (such as lithium carbonate)

Adverse effects
In general, adverse effects seen with indometacin are similar to all other NSAIDs. For instance,  indometacin inhibits both cyclooxygenase-1 and cyclooxygenase-2, which then inhibits the production of prostaglandins in the stomach and intestines responsible for maintaining the mucous lining of the gastrointestinal tract. Indometacin, therefore, like other non-selective COX inhibitors, can cause peptic ulcers. These ulcers can result in serious bleeding or perforation, requiring hospitalization of the patient.
To reduce the possibility of peptic ulcers, indometacin should be prescribed at the lowest dosage needed to achieve a therapeutic effect, usually between 50 and 200 mg/day. It should always be taken with food. Nearly all patients benefit from an ulcer protective drug (e.g. highly dosed antacids, ranitidine 150 mg at bedtime, or omeprazole 20 mg at bedtime). Other common gastrointestinal complaints, including dyspepsia, heartburn and mild diarrhea are less serious and rarely require discontinuation of indometacin.
Many NSAIDs, but particularly indometacin, cause lithium retention by reducing its excretion by the kidneys. Thus indometacin users have an elevated risk of lithium toxicity. For patients taking lithium (e.g. for treatment of depression or bipolar disorder), less toxic NSAIDs such as sulindac or aspirin are preferred.
All NSAIDs, including indometacin, also increase plasma renin activity and aldosterone levels, and increase sodium and potassium retention. Vasopressin activity is also enhanced. Together these may lead to:

Edema (swelling due to fluid retention)
Hyperkalemia (high potassium levels)
Hypernatremia (high sodium levels)
HypertensionElevations of serum creatinine and more serious renal damage such as acute kidney failure, chronic nephritis and nephrotic syndrome, are also possible. These conditions also often begin with edema and high potassium levels in the blood.
Paradoxically yet uncommonly, indometacin can cause headache (10 to 20%), sometimes with vertigo and dizziness, hearing loss, tinnitus, blurred vision (with or without retinal damage). There are unsubstantiated reports of worsening Parkinsons disease, epilepsy, and psychiatric disorders. Cases of life-threatening shock (including angioedema, sweating, severe hypotension and tachycardia as well as acute bronchospasm), severe or lethal hepatitis and severe bone marrow damage have all been reported. Skin reactions and photosensitivity are also possible side effects.
The frequency and severity of side effects and the availability of better tolerated alternatives make indometacin today a drug of second choice. Its use in acute gout attacks and in dysmenorrhea is well-established because in these indications the duration of treatment is limited to a few days only, therefore serious side effects are not likely to occur.
People should undergo regular physical examination to detect edema and signs of central nervous side effects. Blood pressure checks will reveal development of hypertension. Periodic serum electrolyte (sodium, potassium, chloride) measurements, complete blood cell counts and assessment of liver enzymes as well as of creatinine (renal function) should be performed. This is particularly important if Indometacin is given together with an ACE inhibitor or with potassium-sparing diuretics, because these combinations can lead to hyperkalemia and/or serious kidney failure. No examinations are necessary if only the topical preparations (spray or gel) are applied.
Rare cases have shown that use of this medication by pregnant women can have an effect on the fetal heart, possibly resulting in fetal death via premature closing of the Ductus arteriosus.In October 2020, the U.S. Food and Drug Administration (FDA) required the drug label to be updated for all nonsteroidal anti-inflammatory medications to describe the risk of kidney problems in unborn babies that result in low amniotic fluid. They recommend avoiding NSAIDs in pregnant women at 20 weeks or later in pregnancy.

Mechanism of action
Indometacin, a non-steroidal anti-inflammatory drug (NSAID), has similar mode of action when compared to other drugs in this group.  It is a nonselective inhibitor of cyclooxygenase (COX) 1 and 2, the enzymes that participate in prostaglandin synthesis from arachidonic acid. Prostaglandins are hormone-like molecules normally found in the body, where they have a wide variety of effects, some of which lead to pain, fever, and inflammation. By inhibiting the synthesis of prostaglandins, indometacin can reduce pain, fever, and inflammation. Indometacin mechanism of action, along with several other NSAIDs that inhibit COX, was described in 1971.Additionally, indometacin has recently been found to be a positive allosteric modulator (PAM) of the CB1 cannabinoid receptor. By enhancing the binding and signalling of endogenous cannabinoids such as anandamide, PAMs may elicit increased cannabinergic signalling in a tissue specific manner, reducing the incidence of problematic side effects such as psychoactivity while maintaining some antinociceptive activity.Besides, indometacin has logarithmic acid dissociation constant  pKa of 3 to 4.5. Since the physiologic body pH is well above the pKa range of indometacin, most of the indometacin molecules will be dissociated into ionized form, leaving very little un-ionized form of indometacin to cross a cell membrane. If the pH gradient across a cell membrane is high, most of the  indometacin molecules will be trapped in one side of the membrane with higher pH. This phenomenon is called "ion trapping". The phenomenon of ion trapping is particularly prominent in the stomach as pH at the stomach mucosa layer is extremely acidic, while the parietal cells are more alkaline