Endoscopy is a medical examination where a doctor uses a special instrument, called an endoscope, to look inside the body. The endoscope consists of a thin, flexible tube with a camera and a light source on the end. It is used to examine different parts of the body, such as the stomach, intestines, and airways.