He studied in the fields of Unani medicine, courses of Abu Bakr al-Razi, and the science of self-knowledge and ethics under revision of Mirza Hossein Kosar Hamedani, the brother of Reza Vaez, a famous preacher.
Ansari Hamedani reached the level of ijtihad at the age of 24, which was approved by scholars of Qom such as Abdolkarim Haeri Yazdi, Abu l-Hasan al-Isfahani, Mohammad Taqi Khansari and Qomi Borujerdi.
In order to guide this man, Mohammad Javad Ansari Hamedani entered the meeting and gave a speech for about 2 hours that "there is no other way but the Sharia path, and if there is, it is pure deviation."
"[9] After this event, a transformation takes place inside Ansari Hamedani and in order to find a master and a mentor and a guide on the path of divine love, he generally turns away from people, he often goes to the desert to pray and supplicate in the cold and heat weather, or he goes to pilgrimage of the shrine of Fatima bint Musa in Qom, which finally After repeated appeals, a hope arise for him by appeal to the Prophet of Islam and he reached such a level in spiritual side that Seyed Ali Ghazi said about him: "He did not have a teacher in his way and he received monotheism directly from God.
including:[11] A mystical sonnet by Ansari Hamedani: منزلگه آن یار اگر خانه من بود If that friend's house (God) was my house فردوس برین گوشه کاشانه من بود The pure heaven was in the corner of my house شاهان جهان را نشدی هیچ میسر It was not possible at all for the kings of the world to take آن گنج مرادی که به ویرانه من بود That precious intention treasure that was in my ruin هر گوشه چشمی که نمود آن شه خوبان Every reflection of the eye that pure king reveals تیری به دل خسته دیوانه من بود It was a shot to my crazy tired heart گر سوخت مرا جلوه دیدار عجب نیست It's no wonder that a think of sight of him burned me کان شمع مراد دل دیوانه من بود Because that intention candle was wish of my crazy heart هر ناحیه شد جلوه گر از حسن نگاری Every area became a manifestation of reflection of the excellence از پرتو آن دلبر جانانه من بود It was because of reflection of my earnestly lover گر هوش مرا برد لبش روح و روان داد If he took my mind, his lips gave me soul and sense کان آب حیات و می و میخانه من بود It was the fountain of water of life and my beverage and my tavern برد آن خم ابرو، ز کنشتم سوی محراب That eyebrow bend, pulled me from praying to the altar در بیخبری دید که بتخانه من بود Unknowingly, something saw that reflection begins when I busy with my sins لطف ازلی گفت که ای فانی محروم Eternal ethereality said that you, the deprived mortal آزادیت از پند حکیمانه من بود Your freedom comes when my wise advice arose