Looks like an infra-red receiver that's used for TV "remotes". These universally are encapsulated in black plastic that blocks visible light, but is transparent to infra-red light. These are far more complicated than a photo-transistor.
Two pins accept DC power between 3V and 5V.
A third pin is a digital output.
[![ir remote pinout][1]][1] [![IR remote internal block diagram][2]][2]
Most infrared receiver chips contain a pullup resistor between digital output pin and DC supply pin - roughly 30k ohms. This can be probed with an ohmmeter. It is unlikely that a phototransistor would measure 30k ohms between two pins, especially if you reversed the ohmmeter leads, and still measured 30k.
Your posted photo looks like a TSOP38238 , made by VISHAY. Vishay provides data sheets.
Its digital output pin pulls low only when it receives short bursts of 38kHz-modulated infrared light, such as that produced by many TV remote transmitters. Steadily shining infrared light at it produces no output (output remains "high").
[1]: https://i.sstatic.net/LIXz6.png
[2]: https://i.sstatic.net/VTsy3.png