How can I calculate the efficiency of my node in the last 10 or 20 cycles? Are there any special RPC codes for this for add rewiew in to my website?
There are no special RPC APIs for this. You must query either A) tzscan (or other chain indexer) for each cycle's number of successful bakes/endorsements for your tz1 or B) scan the blockchain yourself for the same information. Once you have $numberOfGrantedEndorsements and $numberofMissedEndorsements, then you can calculate the efficiency.