I'm updating a database and trying to move from CAS Registry names to InChiKeys. I have about ~800 compounds to track. Is there a way to do this mappings programatically? I'm looking for a web service or API that already has this implemented, does something like it exist?
Chemical Identifier Resolver can convert several identifiers and has an API so you can convert with a script.
A Python example for CAS to InChIKey:
from urllib.request import urlopen def CIRconvert(cas): try: url = 'http://cactus.nci.nih.gov/chemical/structure/' + cas + '/stdinchikey' ans = urlopen(url).read().decode('utf8') return ans except: return cas casno = ['50-78-2', '69-72-7', '95-1E-6', '108-24-7', '31710-30-2'] for casid in casno: print(CIRconvert(casid)) InChIKey=BSYNRYMUTXBXSQ-UHFFFAOYSA-N InChIKey=YGSDEFSMJLZEOE-UHFFFAOYSA-N 95-1E-6 InChIKey=WFDIJRYMOXRFFG-UHFFFAOYSA-N InChIKey=CIPFDHFTBYJKQB-UHFFFAOYSA-N