Both H1 and H2 receptors are involved in nociception and chronic pain. H1 and H2 antagonists have mild analgesic activity, especially in experimental conditions where pain is induced by histamine. This article should be read in conjunction with that on histamine.
There is old research, mainly with first generation H1 antagonists (mainly diphenhydramine), showing analgesic effects in dysmenorrhoea, atypical head and facial pain, trigeminal neuralgia, and thalamic pain. Diphenhydramine has also been shown to have an analgesic effect as an adjunct to opioids in refractory cancer pain.
The analgesic effects of histamine on the central nervous system and the algesic effects on the peripheral nervous system has lead to some interesting findings in research. In an animal model of neuropathic pain (peripheral axotomy), pain behaviours were decreased with the administration of histidine (precursor to histamine). Knockout mice that have a histamine deficiency had higher pain behaviours. This was thought to be due to central effects. In this study the rats were also treated with loratadine, an H1 antagonist that doesn't pass through the blood brain barrier, and this also reduced pain behaviours. The combination was the most effective.
Fexofenadine is an H1 receptor centrally sparing antagonist. It therefore only acts on peripheral H1 receptors and has been found to profoundly decrease mechanical hypersensitivity in neuropathic pain models. Fexofenadine also has selective COX-2 inhibitor activity which may also contribute to its analgesic effect.
Bilastine is another H1 antagonist available in NZ, and this agent has negligible passage through the blood brain barrier. Cetirizine has some passage centrally, but not as much as the first generation H1 antagonists.
For H2 antagonists, in an experimental animal model (tibial nerve transection), the centrally permeable ranitidine reversed mechanical and cold allodynia. Famotidine on the other hand, which isn't centrally permeable, was completely ineffective. This is obviously contrary to the rule of histamine being analgesic in the central nervous system. The role of ranitidine induced analgesia may be due to different as yet unknown central activities. There are no CNS permeable H2 antagonists available in New Zealand. However another animal study (partial ligation of sciatic nerve) did show analgesic effects of peri sciatic nerve injection of famotidine.
Ketotifen is an H2 antagonist and mast cell stabiliser, but is only available from compounding pharmacies
There are many other studies that have been done, please see Obara et al.
There is also research into the use of H3 antagonists as analgesics in neuropathic pain but none are approved for human use in New Zealand to my knowledge. 
- Open access article on the role of histamine in neuropathic pain by Obara et al.
- Open access article on neurogenic inflammation by Rosa et al.
- Obara I, Telezhkin V, Alrashdi I, Chazot PL. Histamine, histamine receptors, and neuropathic pain relief. Br J Pharmacol. 2020 Feb;177(3):580-599. doi: 10.1111/bph.14696. Epub 2019 Jun 7. PMID: 31046146; PMCID: PMC7012972.
- Yu J, Lou GD, Yue JX, Tang YY, Hou WW, Shou WT, Ohtsu H, Zhang SH, Chen Z. Effects of histamine on spontaneous neuropathic pain induced by peripheral axotomy. Neurosci Bull. 2013 Jun;29(3):261-9. doi: 10.1007/s12264-013-1316-0. Epub 2013 Mar 13. PMID: 23494529; PMCID: PMC5561842.
- Khalilzadeh E, Azarpey F, Hazrati R, Vafaei Saiah G. Evaluation of different classes of histamine H1 and H2 receptor antagonist effects on neuropathic nociceptive behavior following tibial nerve transection in rats. Eur J Pharmacol. 2018 Sep 5;834:221-229. doi: 10.1016/j.ejphar.2018.07.011. Epub 2018 Jul 27. PMID: 30009812.
- Yue JX, Wang RR, Yu J, Tang YY, Hou WW, Lou GD, Zhang SH, Chen Z. Histamine upregulates Nav1.8 expression in primary afferent neurons via H2 receptors: involvement in neuropathic pain. CNS Neurosci Ther. 2014 Oct;20(10):883-92. doi: 10.1111/cns.12305. Epub 2014 Jul 3. PMID: 24990156; PMCID: PMC6493056.
- Obara et al.. Histamine, histamine receptors, and neuropathic pain relief. British journal of pharmacology 2020. 177:580-599. PMID: 31046146. DOI. Full Text.
- Rosa, A C, and R Fantozzi. “The role of histamine in neurogenic inflammation.” British journal of pharmacology vol. 170,1 (2013): 38-45. doi:10.1111/bph.12266