In ancient times, sanpai and sankei indicated a visit to a nearby location to pray to gods or Buddha, but from about the Heian period, people began to visit a shrine or a temple located far away.
古代においては、参拝・参詣といえば近所の神仏に参り詣でるものであったが、平安時代ごろから遠方の寺社にも詣でるようになった。