pubchem.ncbi.nlm.nih.gov/rest/pug - PUG REST API

Q

What is PubChem PUG REST API?

✍: FYIcenter.com

A

PubChem PUG REST API is a Web interface for accessing PubChem data and services, using REST-style version of PUG (Power User Gateway).

You can use URLs to access PubChem data through the interface with the following syntax:

https://pubchem.ncbi.nlm.nih.gov/rest/pug/{input}/{operation}/{output}?{option}

1. {input} - The input portion of the URL tells the interface which records to use as the subject of the query. The input portion is required.

{input} = {domain}/{namespace}/{identifiers}

For example: 
  {input} = compound/name/Aspirin
  {input} = compound/cid/2244 
  {input} = compound/inchikey/BSYNRYMUTXBXSQ-UHFFFAOYSA-N 

The input portion of the URL is required. It tells the interface which records to use as the subject of the query.

For example, the following URL will retrieve the whole record of the "Aspirin" compound record.

https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/Aspirin

2. {operation} - The operation portion of the URL tells the interface what to do with the input records, such as to retrieve whole record data blobs or specific properties of a compound, etc. The operation portion of the URL is optional. If it is not specified, the whole record data blobs are retrieved.

{operation} = record | property/{tag,tag,...}
{tag} = MolecularFormula | MolecularWeight | CanonicalSMILES | ExactMass 
  | InChIKey | ...

For example, the following URL will retrieve the whole record of the "Aspirin" compound record.

https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/record

The following URL will retrieve the molecule formula, InChIKey, and SMILES of compound record with CID=2244.

https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/property/MolecularFormula,InChIKey,CanonicalSMILES/JSON

3. {output} - The output portion of the URL tells the interface what output format is desired. The output portion of the URL is optional. If it is not specified, XML format is used.

{output} = XML | JSON | SDF | CSV | PNG | TXT

For example, the following URL will retrieve the whole record of the "Aspirin" compound record in SDF format. The compound 2D structure will be included in the output.

https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/record/SDF
https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/SDF

The following URL will retrieve the molecule formula, InChIKey, and SMILES of compound record with CID=2244 in JSON format.

https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/property/MolecularFormula,InChIKey,CanonicalSMILES/JSON

4. {option} - The option portion of the URL provides additional options for the output format. The option portion of the URL is optional. If it is not specified, default options are used.

For example, the following URL will retrieve the whole record of the "Aspirin" compound record in SDF format. The compound 3D structure, instead of the default 2D structure, will be included in the output.

https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/SDF?record_type=3d

For more information, visit PUG REST Tutorial.

 

ebi.ac.uk - ChEMBL Compound Database

pubchem.ncbi.nlm.nih.gov Molecule Database

Molecule Online Databases

⇑⇑ Molecule FAQ

2023-01-22, 365🔥, 0💬