API Documentation

Integrate Tailwind Config Validator into your workflow.

POST/api/validate

Validate a Tailwind configuration and receive detailed error reports and suggestions.

Request Body

{
  "config": "module.exports = { ... }",
  "userId": "optional-user-id"
}

Response

{
  "result": {
    "valid": true,
    "errors": [
      {
        "line": 5,
        "message": "Missing required property",
        "severity": "error"
      }
    ],
    "suggestions": [
      {
        "message": "Consider using theme.extend",
        "category": "best-practice"
      }
    ]
  },
  "timestamp": 1234567890
}

Rate Limits

  • Free tier: 5 validations per day per IP
  • Pro tier: Unlimited validations
  • Rate limit exceeded returns 429 status code
GET/api/usage

Check your current usage statistics and remaining validations.

Response

{
  "usage": {
    "count": 3,
    "limit": 5,
    "resetAt": 1234567890,
    "remaining": 2
  }
}

Example Usage

JavaScript/Node.js

const fs = require('fs');

const config = fs.readFileSync('tailwind.config.js', 'utf8');

fetch('https://your-domain.com/api/validate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ config }),
})
  .then(res => res.json())
  .then(data => {
    console.log('Valid:', data.result.valid);
    console.log('Errors:', data.result.errors);
    console.log('Suggestions:', data.result.suggestions);
  });

cURL

curl -X POST https://your-domain.com/api/validate \
  -H "Content-Type: application/json" \
  -d '{"config": "module.exports = { content: [...] }"}'