Drug dependence and withdrawal syndrome induced by abrupt cessation of opioid administration remain a severe obstacle in the clinical treatment of chronic pain and opioid drug addiction. One of the key symptoms during opioid withdrawal is hyperalgesia. The mechanism of opioid withdrawal-induced hyperalgesia remains unclear. P2X2 and P2X3 receptors, members of P2X receptor subunits, act as the integrator of multiple forms of noxious stimuli and play an important role in nociception transduction of chronic neuropathic and inflammatory pain. The process of P2X2 and P2X3 receptor antagonism inhibits inflammatory hyperalgesia, involving the spinal opioid system. However, the role of P2X receptors involved in opioid withdrawal-induced hyperalgesia has seldom been discussed. To explore the role of P2X2 and P2X3 receptors in the opioid-induced hyperalgesia, heroin self-administration rats were adopted, and the thermal and mechanical nociceptive thresholds were evaluated using the paw withdrawal test after abstinence from heroin for 8 days. In addition, the expressions of P2X2 and P2X3 receptors in dorsal root ganglia were analyzed by immunofluorescence. The results showed that after 8 days of abstinence, heroin self-administration rats showed thermal hyperalgesia and mechanical allodynia. Meanwhile, the expressions of the P2X2 and P2X3 receptors in dorsal root ganglia were increased. These results suggest that upregulation of P2X2 and P2X3 receptors might partially play a role in heroin withdrawal-induced hyperalgesia.