How to use Arthor API

Jump to navigation Jump to search


This information was taken from the Arthor version 2.1.2 documentation. RESTful API: The current server implementation utilizes the Data Tables JS library to display hits. The current API therefore reflects some requirements of this library and all URLs are organised under the /dt/ (for data tables) path, in future there may be new URLs introduced to match other clients (e.g. /jchem/).

Data Tables


List all available databases and the types of search available, note a “SUB” in idxTypes means both “SUB” and “SMA” search can be performed:

Example command:

   curl ''

Produces the following JSON:

    {"displayName":"bb-now.smi","location":"/usr/local/tomcat/arthor_data/bb-now.smi","urlFormatStr":null,"idxTypes": ["SIM","SUB"]}, 


Access information on a single database, the virtual memory status is also reported for Similarity and Substructure indexes:


Search a database with a query SMILES/SMARTS.

${db_name} Required path variable, the database name is specified in the URL path as ${db_name}. For one of the databases above, ‘ChEMBL 23’ would be searched as /dt/ ChEMBL%2023/search. query=<string> The query to run either a valid SMILES or SMARTS, depending on search type. type=SUB|SIM|SMA The search type to perform (SUB=Substructure, SMA=SMARTS, SIM=Similarity), these primarily differ by what input is expected in the query= string. Both “SUB” and “SIM” expect a valid SMILES to be provided, “SMA” expects a SMARTS. The SMILES provided to “SUB” is aromatized to be consistent with the database (if flag provided) and converted to a query with any flags specified. This parameter is optional, the default is “SIM”.

start=<num> Optional start offset for the result set to allow paging. The default value is 0 mean- ing the result start at the first hit. length=<num> Optional length of the result set to allow paging. The default is 10. draw=<num> Echoed value to maintain consistent ordering of asynchronous events. A number is provided to this parameter that is returned with the result set. If when the response is received by the client the draw value doesn’t match the current draw value the result can be considered “out of date” and should be ignored. This value is client specific and optional. qopts=<opts> Specify the query options to run the Substructure or SMARTS search with. For example “qopts=RC” would lock the rings and chains of the query. See Arthor::ParseQuery for more info. If your query is an MDL file then you must specify “Mdl” in the qopts.

   //matches server side constants
   let QueryFlags = {
       AROMATISE:    0x0100,
       LOCK_RINGS:    0x0200,
       LOCK_CHAINS:  0x0400,
       LOCK_CHARGES:    0x0800
       LOCK_ISOTOPES:    0x1000,
       LOCK_CONNECTIVITY  0x2000
   //matches UI
                                        QueryFlags.LOCK_CHARGES |
                                         QueryFlags.LOCK_ISOTOPES |

To "lock" means don't allow it to change

Response: The search returns a JSON object containing the result set as a data property

Similarity Search

   curl ''

Substructure or SMARTS Search

A substructure or SMARTS search has some additional complexity. A parameter hasMore indicates whether there are more results. When the first page for a query is requested a background counter is spun up to count the total number of hits. The idea is the server can be pooled until the count is finished.

   curl ''

After some time the background count will have completed and the hasMore will now be false meaning the hit count is correct. The time taken to do the count is set on the time field.