MaConDa API

MaConDa API (application programming interface) consists of the SOAP (Simple Object Access Protocol) / WSDL (Web Services Description Language) interface.

The users can access MaConDa by the SOAP technology over the HTTP protocol. This makes it easy to build a client library for a specific programming language. This enables the users to write their own scripts to access the database.

The service has been tested with Python (suds) and Taverna.

WSDL file

Users can use the MaConDa WSDL file to create a SOAP client.

Quick start Python

#!/usr/bin/env python

from suds.client import Client

url = 'http://www.maconda.bham.ac.uk/soap/maconda.php?wsdl'
client = Client(url)

# 
# EXAMPLE: Diisooctyl phthalate - C24H38O4 - Plasticiser
#


# Search MaConDa by id
inp = {"id": "CON00019"}
result = client.service.getContaminantsById(inp)

for record in result["return"]:
    for item in record:
        # key-value
        print item[0], item[1][0]


# Search MaConDa by formula
inp = {"formula": "C24H38O4"}
result = client.service.getContaminantsByFormula(inp)

for record in result["return"]:
    for item in record:
        # key-value
        print item[0], item[1][0]


# Search MaConDa by name
inp = {"name": "Diisooctyl phthalate"}
result = client.service.getContaminantsByName(inp)

for record in result["return"]:
    for item in record:
        # key-value
        print item[0], item[1][0]



# Search MaConDa by mass
inp = {'mass': 390.277008, 'ppm_error': 0.0}
result = client.service.getContaminantsByExactMass(inp)

for record in result["return"]:
    for item in record:
        print item[0], item[1][0]


inp = {'mass': 413.266235, 'ppm_error': 1.0}
result = client.service.getContaminantsByExactAdductMass(inp)

for record in result["return"]:
    for item in record:
        print item[0], item[1][0]