Neuropeptides are essential for the regulation of appetite. Here we show that neuropeptides could regulate feeding in mutants that lack neurotransmission from the motor neurons that stimulate feeding muscles. We identified nlp-24 by an RNAi screen of 115 neuropeptide genes, testing whether they affected growth. NLP-24 peptides have a conserved YGGXX sequence, similar to mammalian opioid neuropeptides. In addition, morphine and naloxone respectively stimulated and inhibited feeding in starved worms, but not in worms lacking NPR-17, which encodes a protein with sequence similarity to opioid receptors. Opioid agonists activated heterologously expressed NPR-17, as did at least one NLP-24 peptide. Worms lacking the ASI neurons, which express npr-17, did not response to naloxone. Thus, we suggest that Caenorhabditis elegans has an endogenous opioid system that acts through NPR-17, and that opioids regulate feeding via ASI neurons. Together, these results suggest C. elegans may be the first genetically tractable invertebrate opioid model. DOI: http://dx.doi.org/10.7554/eLife.06683.001, eLife digest When and how much an animal eats is controlled by a complex web of signals that are produced by the animal's body and brain. Molecules called opioid neuropeptides are among these signals, and act to control eating in mammals by binding to receptors in the brain and body. These receptors can also bind to similar molecules called opiates (such as morphine); opiates are amongst the oldest drugs used by humans and have diverse effects ranging from pain relief to addiction. While the activities of opiates and opioid neuropeptides have been studied in mammals, relatively little is known about opioid signaling in simpler animals. The mechanisms behind many biological processes have been investigated using a worm called C. elegans as a model system because it has a simple body plan and its genes can be altered easily. The feeding behavior of C. elegans is no exception. This worm feeds by contracting and relaxing its pharyngeal muscle to move food into its gut. When the worms sense that food is available, this ‘pharyngeal pumping’ is regulated by one type of nerve cell. Slow pharyngeal pumping also continues in starved worms when food is not available, possibly to encourage them to eat new potential sources of food. However, this slow pumping does not require the same type of nerve cell. Cheong et al. hypothesized that the slow pumping in starved worms might depend on neuropeptide signaling instead, and have now tested this idea using engineered worms that made lower levels of a number of these molecules. The experiments uncovered a molecule called NLP-24 that promotes the slow pharyngeal pumping. This molecule is similar to opioid neuropeptides found in mammals. Worms that made less NLP-24 than normal grew more slowly; this suggests that they had problems feeding. Moreover, the levels of NLP-24 were found to increase in normal worms soon after they were deprived of food. Further experiments revealed the identity of the receptor for this molecule, which is also similar to mammalian opioid receptors. The discovery that opioid signaling is involved in C. elegans' feeding behavior may well, in future, also help to identify new molecular players involved in opioid signaling. Further studies might also help the search for ways to reduce the problematic side-effects that limit the usefulness of opiate drugs as medicines. DOI: http://dx.doi.org/10.7554/eLife.06683.002