Skip to content

GNPS API Overview

GNPS Library Spectra

All Public Library Spectra at GNPS

https://gnps-external.ucsd.edu/gnpslibraryjson

All Public Library Specta at GNPS with Peaks and Annotation History

Browser all spectra

https://gnps-external.ucsd.edu/gnpslibrary

Download as JSON

https://gnps-external.ucsd.edu/gnpslibrary/ALL_GNPS.json
Example JSON Format
[
    {
        "spectrum_id": "CCMSLIB00000579358",
        "source_file": "Training_001.mgf",
        "task": "03c206430208430c887ca025ea6c3641",
        "scan": "1",
        "ms_level": "2",
        "library_membership": "CASMI",
        "spectrum_status": "1",
        "peaks_json": "[[164.033997,32294.500000],[179.057495,129907.101562]]",
        "splash": "null-null-null-null",
        "submit_user": "lfnothias",
        "Compound_Name": "Theophyllin",
        "Ion_Source": "LC-ESI",
        "Compound_Source": "Commercial",
        "Instrument": "Orbitrap",
        "PI": "CASMI",
        "Data_Collector": "CASMI2016",
        "Adduct": "M-H",
        "Scan": "-1",
        "Precursor_MZ": "179.057",
        "ExactMass": "0.0",
        "Charge": "1",
        "CAS_Number": "N/A",
        "Pubmed_ID": "33919",
        "Smiles": "CN1C2=C(NC=N2)C(=O)N(C)C1=O",
        "INCHI": "\"InChI=1S/C7H8N4O2/c1-10-5-4(8-3-9-5)6(12)11(2)7(10)13/h3H,1-2H3,(H,8,9)\"",
        "INCHI_AUX": "N/A",
        "Library_Class": "1",
        "SpectrumID": "CCMSLIB00000579358",
        "Ion_Mode": " Negative",
        "create_time": "2016-05-24 18:27:20.0",
        "task_id": "03c206430208430c887ca025ea6c3641",
        "user_id": "null",
        "InChIKey_smiles": "ZFXYFBGIUFBOJW-UHFFFAOYSA-N",
        "InChIKey_inchi": "None",
        "Formula_smiles": "C7H8N4O2",
        "Formula_inchi": "",
        "url": "https://gnps.ucsd.edu/ProteoSAFe/gnpslibraryspectrum.jsp?SpectrumID=CCMSLIB00000579358",
        "annotation_history": [
            {
                "Compound_Name": "Theophyllin",
                "Ion_Source": "LC-ESI",
                "Compound_Source": "Commercial",
                "Instrument": "Orbitrap",
                "PI": "CASMI",
                "Data_Collector": "CASMI2016",
                "Adduct": "M-H",
                "Scan": "-1",
                "Precursor_MZ": "179.057",
                "ExactMass": "0.0",
                "Charge": "1",
                "CAS_Number": "N/A",
                "Pubmed_ID": "33919",
                "Smiles": "CN1C2=C(NC=N2)C(=O)N(C)C1=O",
                "INCHI": "\"InChI=1S/C7H8N4O2/c1-10-5-4(8-3-9-5)6(12)11(2)7(10)13/h3H,1-2H3,(H,8,9)\"",
                "INCHI_AUX": "N/A",
                "Library_Class": "1",
                "SpectrumID": "CCMSLIB00000579358",
                "Ion_Mode": " Negative",
                "create_time": "2016-05-24 18:27:20.0",
                "task_id": "03c206430208430c887ca025ea6c3641",
                "user_id": "lfnothias"
            }
        ]
    }
]

As MGF

https://gnps-external.ucsd.edu/gnpslibrary/ALL_GNPS.mgf
Example MGF Format
BEGIN IONS
PEPMASS=407.186
CHARGE=1
MSLEVEL=2
SOURCE_INSTRUMENT=LC-ESI-qTof
FILENAME=Plate1_1_20_GG1_01_16488.mzXML
SEQ=*..*
IONMODE=Positive
ORGANISM=GNPS-SELLECKCHEM-FDA-PART2
NAME=Bortezomib (Velcade) [M+Na]
PI=Dorrestein
DATACOLLECTOR=Garg_Neha
SMILES=C1=CN=CC(=N1)C(N[C@H](C(N[C@H](B(O)O)CC(C)C)=O)CC2=CC=CC=C2)=O
INCHI=N/A
INCHIAUX=N/A
PUBMED=N/A
SUBMITUSER=negarg
LIBRARYQUALITY=1
SPECTRUMID=CCMSLIB00000077995
SCANS=1211
95.886879   236.0
131.058121  188.0
144.823196  204.0
...
1402.281494 144.0
END IONS

As MSP

https://gnps-external.ucsd.edu/gnpslibrary/ALL_GNPS.msp

Single Library Spectrum

https://gnps.ucsd.edu/ProteoSAFe/SpectrumCommentServlet?SpectrumID=<Library Accession>

Example

GNPS Jobs

Job Results API

GNPS job results page in JSON format:

https://gnps.ucsd.edu/ProteoSAFe/result_json.jsp?task=<task id>&view=<view name>

Example

Job Status API

GNPS job status page in JSON format:

https://gnps.ucsd.edu/ProteoSAFe/status_json.jsp?task=<task id>

Job Parameters

GNPS job parameters page in XML format:

https://gnps.ucsd.edu/ProteoSAFe/ManageParameters?task=<task id>

Structure Conversion

Conversion to Smiles

https://gnps-structure.ucsd.edu/smiles?inchi=<inchi string>

Example

Conversion to InChI

https://gnps-structure.ucsd.edu/inchi?smiles=<smiles string>

Example

Conversion to InChIKey

https://gnps-structure.ucsd.edu/inchikey?smiles=<smiles string>

Example

Conversion to fingerprint

https://gnps-structure.ucsd.edu/structurefingerprint?smiles=<smiles string>

Example

Conversion to exact mass

https://gnps-structure.ucsd.edu/structuremass?smiles=<smiles string>

Example

Conversion to formula

https://gnps-structure.ucsd.edu/formula?smiles=<smiles string>

Example

Structure Classyfire

If you have Smiles

https://gnps-structure.ucsd.edu/classyfire?smiles=<smiles string>

Example

If you have InChI

https://gnps-structure.ucsd.edu/classyfire?inchi=<InChI string>

Example

If you have InChI Key

https://gnps-classyfire.ucsd.edu/entities/<InChI Key>.json

Example

Additionally, in case the inchikey is not classified, you can provide smiles or inchi arguments for us to push to the Wishart servers to classify.

ClassyFire

ClassyFire is tool from the Wishart Lab - check it out here. Here is the recommended citation: Feunang, Yannick Djoumbou, Roman Eisner, Craig Knox, Leonid Chepelev, Janna Hastings, Gareth Owen, Eoin Fahy et al. "ClassyFire: automated chemical classification with a comprehensive, computable taxonomy." Journal of cheminformatics 8, no. 1 (2016): 61.

Structure Natural Product Classifier (NP Classifier)

If you have Smiles

https://npclassifier.ucsd.edu/classify?smiles=<smiles string>

Example

Example JSON Output
{
    class_results: [
        "Purine alkaloids"
    ],
    superclass_results: [
        "Pseudoalkaloids"
    ],
    pathway_results: [
        "Alkaloids"
    ],
    isglycoside: false,
    fp1: [
        0,
        0
        ...
    ],
    fp2: [
        0,
        0,
        ...
    ]
}

!!! note "NPClassifier" NPClassifier is A Deep Neural Network-Based Structural Classification Tool for Natural Products - check it out here. For citation: Kim, Hyunwoo; Wang, Mingxun; Leber, Christopher; Nothias, Louis-Felix; Reher, Raphael; Kang, Kyo Bin; et al. (2020): NPClassifier: A Deep Neural Network-Based Structural Classification Tool for Natural Products. ChemRxiv. Preprint. https://doi.org/10.26434/chemrxiv.12885494.v1.

Structure Image

https://gnps-structure.ucsd.edu/structureimg?smiles=<smiles string>

Example

Structure Similarity

https://gnps-structure.ucsd.edu/structuresimilarity?smiles1=<smiles string>&smiles2=<smiles string>

Example

Warning

Please make sure you are URL encoding your SMILES/InChI strings or else the web server on the other end won't understand your request.

Structure External Resource information

https://gnps-external.ucsd.edu/structureproxy?smiles=<smiles string>
Example - Caffeine

Chemical Translation Service

This API uses the Chemical Translation Service made by the Fiehn Lab - check it out here. For citation: Gert Wohlgemuth, Pradeep Kumar Haldiya, Egon Willighagen, Tobias Kind, Oliver Fiehn, The Chemical Translation Service—a web-based tool to improve standardization of metabolomic reports, Bioinformatics, Volume 26, Issue 20, 15 October 2010, Pages 2647–2648, https://doi.org/10.1093/bioinformatics/btq476.

Warning

Please make sure you are URL encoding your SMILES/InChI strings or else the web server on the other end won't understand your request.

ReDU

Per File Sample Information Query

https://redu.ucsd.edu/filename?query=<File full path in MassIVE>

Example

Page Contributions

Ming Wang (99.71%), lfnothias (0.29%)


Last update: April 9, 2021 04:51:09