An optoacoustic sensor is configured to emit electromagnetic radiation and to detect acoustic waves, and a contact element is configured to be brought into contact with the object, the contact element being spaced from the optoacoustic sensor and being transparent to the electromagnetic radiation and the acoustic waves. Further, a scanning unit is configured to cause a movement of the optoacoustic sensor relative to the contact element, and a sealing element is configured to seal a space between the contact element and the optoacoustic sensor. The sealed space contains an acoustic coupling medium. At least a part of the sealing element is flexible to allow for the movement of the optoacoustic sensor relative to the contact element. Further, the optoacoustic sensor comprises a focused ultrasonic transducer configured to detect the acoustic waves generated in the object, the ultrasonic transducer having an axis of symmetry, and a light-emitting element configured to emit the electromagnetic radiation.