# searchProtocols

**Identifier:** `defillama_searchProtocols`

**Provider:** [DefiLlama](https://kirha.com/providers/defillama.md)

Resolve a DeFi protocol name or ticker to its DefiLlama slug. Call this first whenever you only have a name (e.g., 'enzyme', 'compound', 'grove'): slugs are often not the plain name (enzyme is 'enzyme-finance', compound has versioned slugs like 'compound-v3'). Then pass the returned 'slugs' (or a slug field) as the 'protocol' input of getProtocolTvl and getProtocolFeesAndRevenue.

## Run it with the CLI

```bash
kirha tools run defillama_searchProtocols \
  --input '{
    "query": "enzyme"
  }'
```

`--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": "defillama_searchProtocols",
  "input": {
    "query": "enzyme"
  }
}'
```

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": {
    "limit": {
      "default": 5,
      "maximum": 25,
      "minimum": 1,
      "type": "number"
    },
    "query": {
      "description": "protocol name or ticker (e.g., 'enzyme', 'compound', 'GRO')",
      "type": "string"
    }
  },
  "required": [
    "query"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "protocols": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "chains": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "tvlUsd": {
            "type": "number"
          }
        },
        "required": [
          "slug",
          "name",
          "chains"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "slugs": {
      "description": "protocol slugs, best match first, for the 'protocol' input of getProtocolTvl and getProtocolFeesAndRevenue",
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "protocols",
    "slugs"
  ],
  "type": "object"
}
```

## Related tools

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

- [`getProtocolFeesAndRevenue`](https://kirha.com/providers/defillama/getProtocolFeesAndRevenue.md)
- [`getProtocolTvl`](https://kirha.com/providers/defillama/getProtocolTvl.md)

-----

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