How to get difficulty for Bitcoin and other coins
Bitcoins as well as all of the altcoins that I know of have their own API. For example here is bitcoins API. It has a method called getdifficulty which 


  Returns the proof-of-work difficulty as a multiple of the minimum difficulty.


So if you had bitcoind installed, you could then just type in the terminal 

bitcoind getdifficulty