A gastroscopy (upper gastrointestinal endoscopy) is a procedure used to visually examine your upper gastrointestinal tract: esophagus, stomach, and duodenum using a tiny camera on the end of a long, flexible tube. The camera is connected to either an eyepiece for direct viewing or a TV to display the images. When you have symptoms that are unexplained or unresponsive to diet modification or drugs, your physician may order this test for diagnosis and treatment. The most common indications are dyspepsia (upper abdominal pain), persistent heartburn, acute bleeding from the upper gut, and anemia. Less common reasons for the test are an abnormal upper gut X-ray, difficulty swallowing, unexplained weight loss, or when your physician has cause, such as a family history, to think that you are at risk to develop an esophageal or gastric cancer.