Back to Tool
🌈
Gradient Generator API
Generate CSS gradient code programmatically
Endpoint
POST
/api/v1/gradient-generatorAuthentication
Include your API key in the request header:
X-API-Key: your_api_key_hereGet your API key from the Dashboard
Request Body
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
| colors | array | Yes | Array of 2-10 HEX colors (e.g., ["#FF0000", "#0000FF"]) |
| type | string | No | "linear" or "radial" (default: linear) |
| angle | number | No | Angle in degrees for linear gradients (default: 90) |
| positions | array | No | Color stop positions 0-100 (optional) |
Response
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the operation was successful |
| css | string | CSS gradient value |
| cssWithPrefixes | string | CSS with browser prefixes for compatibility |
| colors | array | Normalized color values |
| type | string | Gradient type used |
Code Examples
curl -X POST https://tools.shubhambadgujar.com/api/v1/gradient-generator \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"colors": ["#FF0000", "#00FF00", "#0000FF"], "type": "linear", "angle": 45}'Rate Limits
- • 100 requests per minute
- • 10,000 requests per day
- • Max request size: 10MB
Need Help?
Contact us at support@shubhambadgujar.com