
CSS Box Shadow Generator API
Design
Free CSS box shadow generator with live preview. Customize shadows for UI design and web development. Copy CSS code instantly for your projects.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
120 requests per minute
Endpoints
1 endpoint available
Overview
Build a CSS box-shadow from its parts. The response has the declaration and just the value.
Notes
- Offsets, blur and spread are whole numbers in pixels, between -1000 and 1000. Blur cannot be negative.
- Colours can be hex, a colour name, or an
rgb(),hsl(),hwb(),lab(),lch(),oklab()oroklch()function. Anything else is rejected. - The colour is written to the CSS exactly as you send it.
Endpoints
POST
https://opentools.ca/api/v1/tools/css-box-shadow-generatorGenerate a box-shadow declaration
Request Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| hOffset | number | Optional | Horizontal offset in px, -1000 to 1000.Default: 10 |
| vOffset | number | Optional | Vertical offset in px, -1000 to 1000.Default: 10 |
| blur | number | Optional | Blur radius in px, 0 to 1000.Default: 10 |
| spread | number | Optional | Spread radius in px, -1000 to 1000.Default: 0 |
| color | string | Optional | Shadow colour, e.g. "#000000", "red" or "rgba(0, 0, 0, 0.25)".Default: #000000 |
| inset | boolean | Optional | Draw the shadow inside the box.Default: false |
Response Example
{
"success": true,
"value": "10px 10px 10px 0px #000000",
"css": "box-shadow: 10px 10px 10px 0px #000000;"
}Error Codes
400
Bad Request - Out-of-range number or unsupported colour401
Unauthorized - Invalid or missing API key403
Forbidden - API key inactive, expired, or request from a disallowed IP429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
curl -X POST https://opentools.ca/api/v1/tools/css-box-shadow-generator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"hOffset": 0, "vOffset": 4, "blur": 12, "spread": 0, "color": "rgba(0, 0, 0, 0.25)"}'Rather use it in your browser? Open the CSS Box Shadow Generator