I am building a web UI for testing smart contracts and currently I have to supply the ABI for a contract I test. Is there a way to extract the ABI from a deployed contract (preferably programmatically)?
If the source code has been published to Etherscan, then they have an API to retrieve it. From https://etherscan.io/apis#contracts:
Get Contract ABI for Verified Contract Source Codes
Go to EtherScan > enter the contract address > click on the Code in the tab section heading > Scroll down to find the Contract ABI > click on the Copy icon to copy it
You can also copy your ABI in Remix by going to Compile-->Details(ABI) section