Earthworms are classified into three main ecophysiological categories: (1) leaf litter/compost dwelling worms (epigeic) e.g. Eisenia fetida; (2) topsoil or subsoil dwelling worms (endogeics); and (3) worms that construct permanent deep burrows through which they visit the surface to obtain plant material for food, such as leaves (anecic), e.g. Lumbricus terrestris. 
Earthworm populations depend on both physical and chemical properties of the soil, such as soil temperature, moisture, pH, salts, aeration and texture, as well as available food, and the ability of the species to reproduce and disperse. One of the most important environmental factors is pH, but earthworms vary in their preferences. Most earthworms favor neutral to slightly acidic soil. However, Lumbricus terrestris are still present in a pH of 5.4 and Dendrobaena octaedra at a pH of 4.3 and some Megascolecidae are present in extremely acid humic soils. Soil pH may also influence the numbers of worms that go into diapause. The more acid the soil, the sooner worms go into diapause, and remain in diapause the longest time at a pH of 6.4.
Earthworms form the base of many food chains. They are preyed upon by many species of birds, e.g. starlings, thrushes, gulls, crows, and both European Robins and American Robins. Some snakes feed on them and mammals such as bears, foxes, hedgehogs and moles eat many earthworms as well. Earthworms are also eaten by many invertebrates such as ground beetles and other beetles, snails, slugs. Earthworms have many internal parasites including Protozoa, Platyhelminthes, Nematodes. They are found in many parts of earthworms' bodies such as blood, seminal vesicles, coelom, intestine, or in the cocoons.
The application of chemical fertilizers, sprays and dusts can have a disastrous effect on earthworm populations. Nitrogenous fertilizers tend to create acid conditions, which are fatal to the worms, and often dead specimens are to be found on the surface following the application of substances like DDT, lime sulphur and lead arsenate. In Australia, the use of superphosphate on pastures almost completely wiped out the giant Gippsland earthworm.
Therefore, the most reliable way to maintain or increase the levels of worm population in the soil is to avoid the application of artificial chemicals. Adding organic matter, preferably as a surface mulch, on a regular basis will provide them with their food and nutrient requirements, and also creates the optimum conditions of heat (cooler in summer and warmer in winter) and moisture to stimulate their activity.
A recent threat to earthworm populations in the UK is the New Zealand Flatworm (Artiposthia triangulata), which feeds upon the earthworm, but in the UK has no natural predator itself. At present sightings of the New Zealand flatworm have been mainly localised, but this is no reason for complacency as it has spread extensively since its introduction in 1960 through contaminated soil and plant pots. Any sightings of the flatworm should be reported to the Scottish Crop Research Institute, which is monitoring its spread.
 Economic impact
Various species of worms are used in vermiculture, the practice of feeding organic waste to earthworms to decompose (digest) it, a form of composting by the use of worms. These are usually Eisenia fetida (or its close relative Eisenia andrei) or the Brandling worm, also known as the Tiger worm or Red Wiggler, and are distinct from soil-dwelling earthworms.
Earthworms are sold all over the world. The earthworm market is sizable. According to Doug Collicut (see "Nightcrawler" link below), "In 1980, 370 million worms were exported from Canada, with a Canadian export value of $13 million and an American retail value of $54 million."
Earthworms are also sold as food for human consumption. Noke is a culinary term used by the Māori of New Zealand to refer to earthworms which are considered delicacies.
A report on biodiversity published by the Irish Government in May 2008 estimated the activities of the earthworm to be worth a minimum of €723 millon per annum to Irish agriculture.
 Taxonomy and distribution
The families, with distribution of the main ones:
 See also
 Further reading
Wikimedia Commons has media related to: Earthworms
 Additional images
Retrieved from "http://en.wikipedia.org/wiki/Earthworm"