Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) and Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) narrate: The Prophet (peace and blessings be upon him) used to teach us the istikharah just as he taught us a surah of the Qur'an. (The words of the istikharah are:) "O Allah! I seek Your guidance by Your knowledge and I seek ability through Your power. Indeed You have power and I have no power, You know and I do not know, and You are the Knower of the unseen. O Allah! Whatever decree You have passed upon me, make its outcome good for me."
Al-Tabarani recorded it in al-Mu'jam al-Kabir. Its chain contains a narrator, Abdullah bin Hani' bin Abi Ablah; Ibn Hibban mentioned him in the book "al-Thiqat", and he is muttaham (accused).