An endoscopic capsule has a biocompatible capsule housing that contains at least one sensor device for acquiring medical data. The sensor is arranged on an outer surface of the housing, and has a first electrode produced of an acid-resistant noble metal, and a second electrode produced of silver. An electrical voltage is applied between the first and second electrodes, and a change in an electrical variable is measured between the first and second electrodes when ammonia is present. The endoscopic capsule allows screening of gastric acid and the tissue of the stomach lining for Helicobacter pylori in a manner that is gentle for the patient.