M1 Hub
Back to user guides

SpaceM1 API User Guide

Create a search

Request

POST

http://localhost:2222/api/v2/spacem1-search

Bodyapplication/json

#targets
array of strings
required

Target chemical compounds in SMILES format.

Example value: ["COC", "OCC(N)(CO)CCc1ccc(cc1)CCCCCCC"]

Maximum length: 100 000

#name
string
optional

Name of the search search.

Default value: part of the generated search ID

#targets_metadata
nested dictionary
optional

Targets metadata enables the naming of some compounds of the request. Each key of the parent dictionary should relate to an index of a target in the targets array. Please note that the indices are numbered from 0. As naming compounds is optional, targets_metadata should only contain the keys of targets that you want to name.

Example value: {"0": {"name": "Dicarbon monoxide"}}

Example

curl http://localhost:2222/api/v2/spacem1-search -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: ApiToken-v1 YOUR_API_TOKEN" \
  -d '{
    "targets": [
      "OCC(N)(CO)CCc1ccc(cc1)CCCCCCC",
      "O=C(Nc1cc(Nc2nc(-c3cnccc3)ccn2)c(cc1)C)c3ccc(cc3)CN3CCN(CC3)C",
      "COC"
    ],
    "name": "my-search",
    "targets_metadata": { "2": { "name": "Dicarbon monoxide" } }
  }'

Response

Bodyapplication/json

#id
string

Search ID.

#name
string

Search name.

Default value: part of the generated search ID if not specified in request

#size
integer

Number of targets specified in the search request.

#inputParams
dictionary

parameters specified in the search request.

#searchParams
dictionary

Final parameters used to create the search request. They are a combination of inputParams and presetParams.

#priority
integer

priority specified in the search request or its default value.

#createdAt
string

Search created date and time as an ISO 8601 formatted string.

#source
'WEB' | 'API_V2'

Origin of the search request.

#presetParams
dictionary

Parameters specified by chosen preset in the search request.

Default value: "Default for search" preset configured in the RetroScore interface

#presetName
string

Name of the preset applied to the search request.

Example

{
  "id": "bcd34242-70c3-46f0-819d-e261eaf876f0",
  "name": "my-search",
  "size": 3,
  "inputParams": {
    "availability_tier": 3,
    "length": "short",
    "model": "metro",
    "synthesis_scale": "millimolar",
    "reaction_confidence_threshold": "high",
    "min_reference_count": 10
  },
  "searchParams": {
    "detail_level": "best_path",
    "presets": {
      "model": "metro",
      "length": "short",
      "datasets": [{ "id": "emolecules" }],
      "synthesis_scale": "millimolar",
      "availability_tier": 3,
      "reaction_confidence_threshold": "high",
      "min_reference_count": 10
    }
  },
  "priority": 3,
  "createdAt": "2023-04-07T10:13:29.932Z",
  "source": "API_V2",
  "presetParams": {
    "availability_tier": 3,
    "datasets": [{ "id": "emolecules" }],
    "model": "metro",
    "length": "regular",
    "synthesis_scale": "millimolar",
    "reaction_confidence_threshold": "high",
    "min_reference_count": 10
  },
  "presetName": "base-parameters"
}