A non-invasive technique to monitor cardiac activity in small fish, such as goldfish, zebrafish, and medaka, is needed. In the present study, we developed photocardiography (PCG), a non-invasive optical method, to record cardiac activity in small fish. The method monitors changes in near-infrared light transmission through the heart using a phototransistor located outside the body. With this technique, heartbeats in fish of various sizes (14–218 mm) were stably recorded. PCG was applied to monitor the heartbeat during fear-related classical heart rate conditioning in goldfish wherein an electrical shock was used as an unconditioned stimulus. The heartbeats were continuously monitored, even when the beat coincided with the electrical shock, showing that PCG is robust even in an electrically noisy environment. This technique is particularly useful when monitoring the heartbeats of fish of small size or in the presence of ambient electrical noise, conditions in which the use of conventional electrocardiography (ECG) is difficult.