PubChem Structure Image Service

Generates 2D and 3D structure images for chemical compounds by CID, SID, SMILES, or InChI. Returns PNG images at configurable sizes, suitable for embedding in applications and documents.

API entry from apis.yml

apis.yml Raw ↑
name: PubChem Structure Image Service
description: Generates 2D and 3D structure images for chemical compounds by CID, SID, SMILES, or InChI.
  Returns PNG images at configurable sizes, suitable for embedding in applications and documents.
humanURL: https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest#section=PNG
baseURL: https://pubchem.ncbi.nlm.nih.gov/rest/pug
tags:
- Structure Images
- 2D Structures
- Visualization
properties:
- type: Documentation
  url: https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest#section=PNG
contact:
- FN: PubChem Help Desk
  email: [email protected]
operations:
- summary: Get compound 2D structure image by CID
  method: GET
  path: /compound/cid/{cid}/PNG
  description: Returns a PNG image of the 2D chemical structure for the given compound ID. Size can be
    controlled with the image_size parameter.
- summary: Get compound image by name
  method: GET
  path: /compound/name/{name}/PNG
  description: Returns a PNG image of the 2D chemical structure for a compound looked up by name.
- summary: Get compound image by SMILES
  method: GET
  path: /compound/smiles/{smiles}/PNG
  description: Returns a PNG image of the 2D chemical structure for the compound specified by SMILES string.