King cobras are considered tertiary consumers and are often the apex predator of a food web. According to Blue Planet Biomes, their only predators are human beings, birds of prey and the mongoose.
King cobras primarily prey upon other snakes, many of which, in turn, hunt herbivores. Although they may be weaned onto conventional snake food such as rodents when in captivity, king cobras generally hunt other predators, including pythons and the Asian rat snake. Some cobras specialize in eating only one particular snake species. Their diet sometimes includes animals below predator snakes on the food chain, but they are not the cobra's preferred meal.