# findCompound

**Identifier:** `pubchem_findCompound`

**Provider:** [PubChem](https://kirha.com/providers/pubchem.md)

Resolve a chemical or drug identifier to PubChem compound IDs (CIDs). Names include brand names (Lipitor), INN/generic names, synonyms, CAS registry numbers and code names. Brand names often resolve to a salt form (e.g. a mesylate); parentCids then gives the active parent compound, which is the one to use for bioassays and ChEMBL/target lookups. Use the CIDs with getCompoundProperties, getCompoundSynonyms (ChEMBL/DrugBank/UNII/CAS IDs), getBioassaySummary or getCompoundAnnotations.

## Run it with the CLI

```bash
kirha tools run pubchem_findCompound \
  --input '{
    "identifier": "aspirin"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "pubchem_findCompound",
  "input": {
    "identifier": "aspirin"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "identifier": {
      "description": "e.g. aspirin, Lipitor, 50-78-2, CC(=O)OC1=CC=CC=C1C(=O)O",
      "minLength": 1,
      "type": "string"
    },
    "identifierType": {
      "default": "name",
      "description": "Use name for CAS numbers too",
      "enum": [
        "name",
        "smiles",
        "inchikey"
      ],
      "type": "string"
    },
    "limit": {
      "default": 10,
      "maximum": 20,
      "minimum": 1,
      "type": "number"
    }
  },
  "required": [
    "identifier"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "cids": {
      "description": "PubChem CIDs for the other PubChem tools",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "compounds": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "cid": {
            "type": "number"
          },
          "inchiKey": {
            "type": "string"
          },
          "iupacName": {
            "type": "string"
          },
          "molecularFormula": {
            "type": "string"
          },
          "molecularWeight": {
            "type": "number"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "cid"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "context": {
      "type": "string"
    },
    "parentCids": {
      "description": "Parent compounds (salts, hydrates and mixtures stripped) when they differ from cids",
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "compounds",
    "cids"
  ],
  "type": "object"
}
```

## Related tools

Other PubChem tools that this tool refers to, or that refer to it.

- [`getCompoundSynonyms`](https://kirha.com/providers/pubchem/getCompoundSynonyms.md)
- [`getCompoundProperties`](https://kirha.com/providers/pubchem/getCompoundProperties.md)
- [`getCompoundAnnotations`](https://kirha.com/providers/pubchem/getCompoundAnnotations.md)
- [`getBioassaySummary`](https://kirha.com/providers/pubchem/getBioassaySummary.md)

-----

[All PubChem tools](https://kirha.com/providers/pubchem.md) · [< Back to tools list](https://kirha.com/tools.md)