A tethered capsule that is swallowed by the patient offers a quick and pain-free method of screening and diagnosing gastrointestinal diseases. Diagnosing gastrointestinal (GI) diseases usually involves endoscopy, combining an invasive probe and video imaging or other optical methods. While effective, this method often causes patient discomfort and typically requires anesthesia, making it costly and time-consuming. Here we describe a new option for screening using a swallowable optomechanically engineered pill that rapidly provides 3D microscopic images of the gastrointestinal tract. The process is pain-free, so there is no need for anesthesia, and enables quick diagnosis of esophageal diseases.