The Shanhaijing 山海經 "Classic of mountains and seas" is a kind of early geography of China. The modern version has 18 juan "scrolls" and consists of four parts describing "mountains" (Shanjing 山經), "seas" (Haijing 海經), "the great wilderness" (Dahuangjing 大荒經), and China herself (Haineijing 海內經). Another arrangement divides the book into two parts, the Shanjing 山經 or Wucang shanjing 五藏山經 which consists of five geographical chapters, and the Haijing 海經 which consists of the parts Haiwaijing 海外經, Haineijing 海內經 (four chapters each) and Dahuangjing 大荒經 (five chapters).
Authorship is traditionally attributed to Emperor Yu 禹, the mythological founder of the Xia dynasty 夏 (17th to 15th cent. BCE), or Bo Yi 伯益, one of his ministers, or is said to be a chart of the ding 鼎 cauldrons Yu the Great erected in the provinces of China. Modern scholars believe that the book was compiled during the late Warring States 戰國 (5th cent. - 221 BCE) and Han 漢 (206 BCE-220 CE) periods and is the product of a long time of compilation.
The first two parts of the book can be seen as Daoist writings. The first part deals with mountais and their nature and character, plants, animals and ores, all being features relevant for the ideal performance of Daoist shamans working there. It was probably compiled during the 4th and 3rd centuries BCE. The second part deals with foreign countries and its inhabitants and contains a lot of mythological stories and tales about strange persons and animals. It was probably written during the late 3rd or the 2nd centuries BCE. The last two parts were originally supplements compiled by the Former Han period 漢 (206 BC-8 AD) scholars Liu Xiang 劉向 or Liu Xin 劉歆. Only when Guo Pu 郭璞 started compiling his commentary during the 4th century the supplements were dealt with as proper parts of the classic.
Although the stories told in the Shanhaijing are historically not reliable they are valuable sources for the study of early Chinese mythology, and eventually for the origin of certain parts of Chinese popular religion. The Yellow Emperor 黃帝, for example, can be found out to have been a deity venerated in western China. The Shanhaijing is a rich source of information on early Chinese history, geography, astronomy, climate, religion, customs and habits, animals and plants, minerals, medicine, rivers and marine sciences. In the earliest bibliography Qilüe 七略 the Shanhaijing was classified as a writing of divinatory (shushu 數術) character, yet from the Tang period 唐 (618-907) on it was seen as a geographical book. During the Song period 宋 (960-1279) the many superstitional and fictional accounts were the reason for its categorization as a book of cosmological character (wuxing 五行). In later ages the Shanhaijing was seen as a collection of phantastic stories and can be seen as the ancestor of Chinese novellas and fiction (xiaoshuo 小說).
Guo Pu's commentary to the Shanhaijing is the oldest. During the Qing period 清 (1644-1911) Hao Yixing 郝懿行 wrote a commentary, the Shanhaijing jianshu 山海經箋疏. Less important commentaries were written by Yang Shen 楊慎, Wang Chongqing 王崇慶, Wang Niansun 王念孫, He Zhuo 何焯, Wu Renchen 吳任臣 and Bi Yuan 畢沅. The most recent commentary is Yuan Ke's 袁珂 Shanhaijing jishi 山海經集釋 from 1980.
The Shanhaijing is to be found in the Daoist Canon Daozang 道藏 and the collectaneaGujin yishi 古今逸史, Siku quanshu 四庫全書, Gezhi congshu 格致叢書, Ershierzi 二十二子, Baizi quanshu 百子全書, Mishu ershiyi zhong 秘書二十一種, Sibu congkan 四部叢刊, Sibu beiyao 四部備要 and Longxi jingshe congshu 龍溪精舍叢書.
There are translations by Schiffeler (only partial), Thern, Yuan K'o, Mathieu, and Anne Birrell (1999). The Classic of Mountains and Seas. London: Penguin.

Shanjing 山經 The classic of mountains
1. 南山經 Nanshan The classic of the southern mountains
2. 西山經 Xishan The classic of the western mountains
3. 北山經 Beishan The classic of the northern mountains
4. 東山經 Dongshan The classic of the eastern mountains
5. 中山經 Zhongshan The classic of the central mountainsHaijing 海經 The classic of the seasHaiwaijing 海外經 The classic of the regions beyond the seas
6. 海外南經 Haiwai nan The classic of regions beyond the seas: The south
7. 海外西經 Haiwai xi The classic of regions beyond the seas: The west
8. 海外北經 Haiwai bei The classic of regions beyond the seas: The north
9. 海外東經 Haiwai dong The classic of regions beyond the seas: The eastHaineijing 海內經 The classic of the regions within seas
10. 海內南經 Hainei nan The classic of regions within the seas: The south
11. 海內西經 Hainei xi The classic of regions within the seas: The west
12. 海內北經 Hainei bei The classic of regions within the seas: The north
13. 海內東經 Hainei dong The classic of regions within the seas: The eastDahuangjing 大荒經 The classic of the great wilderness
14. 大荒東經 Dahuang dong The classic of the great wilderness: The east
15. 大荒南經 Dahuang nan The classic of the great wilderness: The south
16. 大荒西經 Dahuang xi The classic of the great wilderness: The west
17. 大荒北經 Dahuang bei The classic of the great wilderness: The north
18. 海內經 Hainei The classic of regions within the seas