Skip to content

Commit

Permalink
feat (hierarchical): improving the example
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Oct 15, 2021
1 parent de9c676 commit f5e7773
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions hierarchical/pubchem-xml-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Let us build an API request using the popular name aspirin:
https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/aspirin/JSON

Retrieving from its PubChem code (2244):

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

Retrieving other compounds:
Expand All @@ -32,7 +33,7 @@ Retrieving other compounds:
* `Cellulase`
https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/cellulase/JSON

Retrieving its synonyms:
Retrieving synonyms of Acetylsalicylic Acid:
https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/synonyms/XML

Retieving a substance related to Acetylsalicylic Acid whose code is 49854366. It is described here:
Expand All @@ -43,10 +44,24 @@ It is possible to retrieve data from this substance with the REST request:

https://pubchem.ncbi.nlm.nih.gov/rest/pug/substance/sid/49854366/XML

Building customized queries with:
* `Aspirin`
* `Glucose`
* `Cellulose`
* `Cellulase`
Building customized queries putting together:
* `Aspirin` - CID: `2244`
* `Glucose` - CID: `5793`
* `Cellulose` - CID: `16211032`
* `Cellulase` - CID: `440950`

Showing the fields:
* `Title`
* `MolecularWeight`
* `MolecularFormula`
* `CanonicalSmiles`
* `HBondDonorCount`
* `HBondAcceptorCount`
* `InChIKey`
* `InChI`

https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244,5793,16211032,440950/property/Title,MolecularWeight,MolecularFormula,CanonicalSmiles,HBondDonorCount,HBondAcceptorCount,InChIKey,InChI/JSON

The possible fields are described at:

https://pubchemdocs.ncbi.nlm.nih.gov/pug-rest$_Toc494865567

0 comments on commit f5e7773

Please sign in to comment.