get-text-property

get-text-property is a built-in function in `C source code'.

(get-text-property POSITION PROP &optional OBJECT)

Return the value of POSITION's property PROP, in OBJECT.
OBJECT should be a buffer or a string; if omitted or nil, it defaults
to the current buffer.
If POSITION is at the end of OBJECT, the value is nil.