API Documentation

Use the DirtyMarkup API to programmatically clean your code. This service is currently offered free of charge, but is subject to change at any time.

Please Contribute

DirtyMarkup is a free service that gets a lot of traffic and its hosting isn’t cheap. To keep it running, I’m asking you to make a small donation today.

If you’re using the API you have a social responsibility to contribute something back to the project. Please help me keep DirtyMarkup online by making a small contribution.

Funds collected help pay for hosting and continued development. Thanks for supporting DirtyMarkup’s mission to rid the world of dirty code!

Contribute with PayPal

HTML

To clean your HTML, send the following request:

POST https://dirtymarkup.com/api/html

Parameters

CSS

To clean your CSS, send the following request:

POST https://dirtymarkup.com/api/css

Parameters

Note: the “Preferred line length” option doesn’t have any effecton CSS code. It only sets the visual ruler in the editor, so there is nocorresponding API parameter.

JavaScript

To clean your JavaScript, send the following request:

POST https://dirtymarkup.com/api/js

Parameters

API Responses

Every request to the API will return one of the following HTTP codes.

Successful responses will contain a JSON string:

{"clean": "your clean code"}

API Limits

DirtyMarkup has a soft rate limit of 1,000 requests per day per IP address. If you consistently exceed the limit, your IP address will be blacklisted to preserve resources for other users.

Again, DirtyMarkup is a free service. If you're application will require significant usage of the API, please contact @claviska about sponsoring the service before launching.

About DirtyMarkup

DirtyMarkup is a free service built by Cory LaViska and provided as a courtesy by his company, A Beautiful Site, LLC. DirtyMarkup is offered without warranty of any kind. Use of DirtyMarkup and its API is strictly at your own risk. DirtyMarkup does not retain any of your code or personal information for any reason.

If you made something cool with the API, need help, or would like to report a bug, please contact @claviska.