Well under the original compendium it was pretty easy though I would not call it trivial, Not sure now, they amy have changed the way the Compendium works. The old one passed in parameters via the url there were some details published by a developer at one point.
As for legal, probalby not and most certainly in voilation of user agreements.
As for legal, probalby not and most certainly in voilation of user agreements.