Back to Tool
🌈

Gradient Generator API

Generate CSS gradient code programmatically

Endpoint

POST/api/v1/gradient-generator

Authentication

Include your API key in the request header:

X-API-Key: your_api_key_here

Get your API key from the Dashboard

Request Body

Content-Type: application/json

FieldTypeRequiredDescription
colorsarrayYesArray of 2-10 HEX colors (e.g., ["#FF0000", "#0000FF"])
typestringNo"linear" or "radial" (default: linear)
anglenumberNoAngle in degrees for linear gradients (default: 90)
positionsarrayNoColor stop positions 0-100 (optional)

Response

FieldTypeDescription
successbooleanWhether the operation was successful
cssstringCSS gradient value
cssWithPrefixesstringCSS with browser prefixes for compatibility
colorsarrayNormalized color values
typestringGradient 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}'

Pricing

$0.0010 per call

Get API Key

Rate Limits

  • • 100 requests per minute
  • • 10,000 requests per day
  • • Max request size: 10MB

Need Help?

Contact us at support@shubhambadgujar.com