text: user3061: I am looking for a python package that can convert InChi keys (e.g.SGNXVBOIDPPRJJ-UHFFFAOYSA-N) to molecular structure or SMILES strings. Can I do that with RDKit? 
  The key comes from: https://www.metabolomicsworkbench.org/databases/refmet/refmet_latest.txt
  
  user3061: Slightly modified Matteos answer:
  import requests
  def get_smiles_from_inchikey(inchikey):
      r = requests.get(f'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/inchikey/{inchikey}/property/CanonicalSMILES/JSON').json()
      return r['PropertyTable']['Properties'][0]['CanonicalSMILES']
  
  inchikey = 'SGNXVBOIDPPRJJ-UHFFFAOYSA-N'
  get_smiles_from_inchikey(inchikey)
  
  
  user6322: Yes, RDKit can be used, however, if you installed it with conda it will not work out of the box for inChi key fetching. You can either spend some time installing the missing bit or use something else. It is not like Mol2 support in RDKit, which shouldn't be used, it is just not worth the bother.
  I would suggest PubChem's RESTFul API.
  Say 
   import requests
   ethanol = 'LFQSCWFLJHTTHZ-UHFFFAOYSA-N'
   r = requests.get(f'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/inchikey/{ethanol}/property/CanonicalSMILES/JSON').json()
   smiles = r['PropertyTable']['Properties'][0]['CanonicalSMILES']
  
  
original_text: 3061: <p>I am looking for a python package that can convert InChi keys (e.g.SGNXVBOIDPPRJJ-UHFFFAOYSA-N) to molecular structure or SMILES strings. Can I do that with RDKit? </p>
  
  <p>The key comes from: <a href="https://www.metabolomicsworkbench.org/databases/refmet/refmet_latest.txt" rel="nofollow noreferrer">https://www.metabolomicsworkbench.org/databases/refmet/refmet_latest.txt</a></p>
   3061: <p>Slightly modified Matteos answer:</p>
  
  <pre><code>import requests
  def get_smiles_from_inchikey(inchikey):
      r = requests.get(f'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/inchikey/{inchikey}/property/CanonicalSMILES/JSON').json()
      return r['PropertyTable']['Properties'][0]['CanonicalSMILES']
  
  inchikey = 'SGNXVBOIDPPRJJ-UHFFFAOYSA-N'
  get_smiles_from_inchikey(inchikey)
  </code></pre>
   6322: <p>Yes, RDKit can be used, however, if you installed it with <code>conda</code> it will not work out of the box for inChi key fetching. You can either spend some time installing the missing bit or use something else. It is not like Mol2 support in RDKit, which shouldn't be used, it is just not worth the bother.</p>
  
  <p>I would suggest <a href="https://pubchemdocs.ncbi.nlm.nih.gov/pug-rest" rel="nofollow noreferrer">PubChem's RESTFul API</a>.</p>
  
  <p>Say </p>
  
  <pre><code> import requests
   ethanol = 'LFQSCWFLJHTTHZ-UHFFFAOYSA-N'
   r = requests.get(f'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/inchikey/{ethanol}/property/CanonicalSMILES/JSON').json()
   smiles = r['PropertyTable']['Properties'][0]['CanonicalSMILES']
  </code></pre>
  