The presence of parasites on the farm can be a cause of losses in animal production, and often a threat to public health. A cross-sectional study was carried out in rural areas of the western highlands of Cameroon to determine the prevalence and husbandry-related risk factors associated with Cordylobia anthropophaga infestations in domestic cavies. The overall prevalence of myiasis in animals was 2·80% [95% confidence interval (CI) 1·50–5·10]; myiasis was found in 2% and 4·30% animals in Menoua and Bamboutos divisions, respectively. Eleven farms (8·95%) in total were infested with C. anthropophaga, with 6·41% and 13·34% of farms in the Menoua and Bamboutos divisions, respectively. The relative risk of infestation within each factor showed that the risk of myiasis in animals kept in kitchen compartments without litter was 6·16 times higher (95% CI 1·71–22·29, P = 0·04) than in animals kept in kitchens and house floors. Despite the low prevalence, the burden of cordylobiasis needs to be assessed. It is assumed that the risk of humans acquiring the disease is higher in farmers keeping cavies in kitchen compartments without litter. Farmers need to be educated on control measures to reduce the risk of infestation, which include both sanitation and medical (larvae extraction) measures.