Apple and pear seeds and the inner stony pit (kernel) of apricots and peaches contain a naturally occurring substance called amygdalin which is a cyanogenic glycoside. Amygdalin can release hydrogen cyanide in the stomach causing discomfort or illness, it can sometimes be fatal.
There are different types of apricot kernels, some of which contain high levels of the toxin that can release cyanide into the body when eaten for this reason Food Standards Australia New Zealand has banned the sale of raw apricot kernels see their advice.
Accidental swallowing of an occasional seed or pip is not a concern. However, do not make a habit of eating the seeds from these fruits. For a young child, swallowing only a few seeds or pits may cause illness and in rare cases can be fatal.
See more about Natural toxins in food