> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whetdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Nudges

> Generate improvement suggestions for your text.

## Overview

Generate actionable improvement suggestions for your text. This action analyzes your content and provides specific, prioritized recommendations to enhance quality and conversion potential.

## Use This Action To

* Get specific suggestions to improve your text
* Receive prioritized recommendations
* Enhance content quality and conversion potential

## Parameters

<ParamField body="action" type="array" required>
  Must be an array that includes `"nudges"`
</ParamField>

<ParamField body="text" type="string" required>
  Text to improve (max 5,000 characters)
</ParamField>

<ParamField body="ruleset" type="string" required>
  Ruleset name (e.g., "product\_review", "product\_description")
</ParamField>

<ParamField body="max_nudges" type="integer" required>
  Maximum number of nudges to generate (minimum: 1)
</ParamField>

<ParamField body="context" type="string">
  Optional context about the text (e.g., question text, what the text box aims to do, etc.)
</ParamField>

## Response

```json theme={null}
{
  "success": true,
  "action": ["nudges"],
  "ruleset": "product_review",
  "max_nudges": 3,
  "nudges": [
    {
      "type": "improvement",
      "suggestion": "Add context to clarify what the cup is for or where it is.",
      "priority": "0.8"
    },
    {
      "type": "improvement",
      "suggestion": "Use more descriptive language to evoke visuals or emotions.",
      "priority": "0.7"
    }
  ]
}
```

## Example

```bash cURL theme={null}
curl -X POST https://whetdata.com/api/nudges \
  -H "x-api-key: whet_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "action": ["nudges"],
    "text": "a dashing red cup ",
    "ruleset": "product_review",
    "max_nudges": 3
  }'
```

## Tips

<Tip>
  Higher priority scores (0.8-1.0) indicate more critical improvements, while
  lower scores (0.1-0.4) are nice-to-have enhancements.
</Tip>

<Warning>
  The maximum text length is 5,000 characters. For longer texts, split them into
  chunks.
</Warning>


## OpenAPI

````yaml POST /api/nudges
openapi: 3.0.0
info:
  title: Whetdata API
  version: 1.0.0
servers:
  - url: https://whetdata.com
security: []
paths:
  /api/nudges:
    post:
      summary: Nudges
      description: Generate improvement suggestions for your text.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - action
                - text
                - ruleset
              properties:
                action:
                  type: array
                  items:
                    type: string
                    enum:
                      - nudges
                ruleset:
                  type: string
                text:
                  type: string
                  maxLength: 5000
                max_nudges:
                  type: integer
                  minimum: 1
            example:
              action:
                - nudges
              text: 'a dashing red cup '
              ruleset: product_review
              max_nudges: 3
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
              example:
                success: true
                action:
                  - nudges
                ruleset: product_review
                max_nudges: 3
                nudges:
                  - type: improvement
                    suggestion: Add context to clarify what the cup is for or where it is.
                    priority: '0.8'
                  - type: improvement
                    suggestion: >-
                      Use more descriptive language to evoke visuals or
                      emotions.
                    priority: '0.7'
                  - type: improvement
                    suggestion: Include specific measurements or details about the cup.
                    priority: '0.6'

````