How to use SmallWorld API
Introduction
The Web Services API for SmallWorld Documentation is found in Section 8.3 of the SmallWorld version 4.0 manual starting from page 30 to 36. I copied the section here, and provided a list of publicly available databases for searching on sw.docking.org and some simple examples at the bottom.
8.3 Web Services API
Unless stated otherwise all API entry points operate on HTTP GET/POST requests. A search on the server is first submitted (/search/submit), this returns a stream of events that report the hit list id (hlid). You can then use this hlid to fetch results either as JSON (/search/view) or TSV (/ search/export). An example Java client, SwHttpClient.java, shows how this works.
/search/submit
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.
Parameter | Type | Description |
---|---|---|
smi | text | Query SMILES |
db | text | Reference database (see List of available maps) |
dist | int | Topological distance upper bound (default: 10) |
tdn | int | Topological terminal down distance upper bound (default: 10) |
tup | int | Topological terminal up distance upper bound (default: 10) |
rdn | int | Topological ring down distance upper bound (default: 10) |
rup | int | Topological ring up distance upper bound (default: 10) |
ldn | int | Topological linker down distance upper bound (default: 10) |
lup | int | Topological linker up distance upper bound (default: 10) |
scores | text | List of scoring functions (default : none) - see /search/config |