Dictionaries are in /Library/Dictionaries/
Each Dictionary is a bundle (with a .dictionary extension). Within each dictionary bundle in the resources is a (localised) xml file called <DictionaryName>.xml. You can parse the xml (the format looks quite simple) to get all the keys (and definitions if you want).