Skip Navigation

ChemSpell Web Service API

ChemSpell web service overview

The ChemSpell Web Service API provides chemical name spell checking and chemical name synonym look-up. ChemSpell contains more than 1.3 million chemical names related to organic, inorganic, pharmaceutical, toxicological, and environmental health topics. ChemIDplus is the source for ChemSpell. When a chemical name is entered, ChemSpell returns a list of chemical synonyms if the spelling is correct. If the spelling is incorrect, it returns a list of suggestions for alternate spellings.

Software developers can write applications that connect remotely to the ChemSpell Web service. Communication is performed via Simple Object Access Protocol (SOAP), an XML-based mechanism for exchanging typed information.

The ChemSpell Web Service API is free of charge. Neither registration or licensing is required. If you build an interface using the ChemSpell Web Service API, please indicate that the information is from ChemSpell or the National Library of Medicine. If you have questions about the ChemSpell Web Service API, please contact us."

Example


ChemSpell WSDL

ChemSpell Web Service uses WSDL standards. WSDL stands for Web Service Definition Language, an XML-based language for describing Web services. ChemSpell Web Service WSDL specifies the location of the service and the operations (or methods) of ChemSpell.

RPC profile for ChemSpell service

This table summarizes all the necessary parameters needed to configure a SOAP RPC call. The information is derived automatically from the ChemSpell Web Service WSDL file.
Method Name getSugList
Endpoint URL http://chemspell.nlm.nih.gov:80/axis/SpellAid.jws
Method Namespace URI http://chemspell.nlm.nih.gov
Input Parameters
Name string
 
Name Source string
Set the value as: "All databases"
Output Parameters
Result string

Client sample program

        package sis.spell;

        import org.apache.axis.client.Call;
        import org.apache.axis.client.Service;
        import javax.xml.namespace.QName;
        import java.net.*;

        public class SpellClient {
          public static void main(String [] args) throws Exception
            {
              String name = "benzene", nameSource = "All databases",
                result=null;

              Service service = new Service();
              Call call = (Call)service.createCall();

              String endpoint =
                "http://chemspell.nlm.nih.gov/axis/SpellAid.jws";
              call.setTargetEndpointAddress(new URL(endpoint));

              name=args[0];
              nameSource=args[1];
              call.setOperationName(new
                QName("http://chemspell.nlm.nih.gov", "getSugList"));
              result = (String)call.invoke(new Object [] {new
                String(name), new String(nameSource)});
              System.out.println("Got result : " + result);
            }
          }
        

XML schema for ChemSpell web service result

Schema for Synonym Result

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Synonym">
<xs:complexType>
<xs:sequence>
<xs:element name="Chemical" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Schema for Spell Aid Result

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="SpellAid">
<xs:complexType>
<xs:sequence>
<xs:element name="Chemical" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Top