Back to Tool
< />
XML Formatter API
Format, validate, and minify XML data programmatically
Endpoint
POST
/api/v1/xml-formatterAuthentication
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 |
|---|---|---|---|
| xml | string | Yes | The XML string to process |
| action | string | Yes | Action to perform: "format", "minify", or "validate" |
| indent | number | No | Number of spaces for indentation (default: 2, only for format action) |
Response
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the operation was successful |
| result | string | The formatted/minified XML (for format/minify actions) |
| valid | boolean | Whether the XML is valid (for validate action) |
| error | string | Error message if validation failed |
Code Examples
curl -X POST https://tools.shubhambadgujar.com/api/v1/xml-formatter \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"xml": "<root><item>Hello</item></root>",
"action": "format",
"indent": 2
}'Rate Limits
- • 100 requests per minute
- • 10,000 requests per day
- • Max request size: 10MB
Need Help?
Contact us at support@shubhambadgujar.com