# searchWarningLetters

**Identifier:** `openfda_searchWarningLetters`

**Provider:** [OpenFDA](https://kirha.com/providers/openfda.md)

Search FDA warning letters by company name or any keyword in the letter text (product, violation, ingredient), newest posted first. Wrap a phrase in double quotes for an exact match, e.g. "Sun Pharmaceutical". Returns issue and posting dates, issuing office, subject (violation types), a matching excerpt and the letter URL. Without a query, returns the latest posted letters.

## Run it with the CLI

```bash
kirha tools run openfda_searchWarningLetters \
  --input '{}'
```

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

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": 10,
      "maximum": 25,
      "minimum": 1,
      "type": "integer"
    },
    "offset": {
      "default": 0,
      "maximum": 5000,
      "minimum": 0,
      "type": "integer"
    },
    "query": {
      "default": "",
      "description": "e.g. \"compounded semaglutide\", Aurobindo, data integrity",
      "type": "string"
    }
  },
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "letters": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "company": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "issuingOffice": {
            "type": "string"
          },
          "letterIssueDate": {
            "type": "string"
          },
          "postedDate": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "company"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "nextOffset": {
      "type": "number"
    },
    "total": {
      "type": "number"
    }
  },
  "required": [
    "context",
    "total",
    "letters"
  ],
  "type": "object"
}
```

-----

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