curl --request GET \
--url https://api.example.com/api/fetchHtml{
"success": true,
"html": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}Fetches and cleans HTML content from a URL
curl --request GET \
--url https://api.example.com/api/fetchHtml{
"success": true,
"html": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
}
}curl -X GET "https://yourdomain.com/api/fetchHtml?url=https://example.com/recipe/chocolate-chip-cookies"
curl -X GET "https://yourdomain.com/api/fetchHtml?url=https%3A%2F%2Fexample.com%2Frecipe%2Fchocolate-chip-cookies"
{
"success": true,
"html": "<div class=\"recipe\">...</div>"
}
false for error responses.<script>, <style>, <noscript>, <link>, <meta><svg>, <symbol>, <img>, <iframe>, <video>, <audio>, <canvas><button>, <form>, <input>, <select>, <option>.navbar, .header, .footer, .sidebar, .breadcrumb, .nav.ad, .ads, .sponsor, .promo, .adsbygoogle, .outbrain, .taboola.social, .share, .yummly-share.rating, .comments, .comment, .rmp-rating-widget.mobile-banner, .app-banner, .push-modal.wp-block-*, .widget.print-btn, .scroll-to-top, .search-box, .tooltips| Error Code | Status | Description |
|---|---|---|
ERR_INVALID_URL | 200 | URL parameter is missing or invalid format |
ERR_NO_RECIPE_FOUND | 200 | Page not found (404), empty content, or no content after cleaning |
ERR_FETCH_FAILED | 200 | Network error or server error (5xx) |
ERR_TIMEOUT | 200 | Request timed out after 10 seconds |
ERR_UNKNOWN | 200 | Unexpected error occurred |
{
"success": false,
"error": {
"code": "ERR_INVALID_URL",
"message": "No URL provided"
}
}
{
"success": false,
"error": {
"code": "ERR_INVALID_URL",
"message": "Invalid URL format"
}
}
{
"success": false,
"error": {
"code": "ERR_TIMEOUT",
"message": "Request timed out"
}
}
{
"success": false,
"error": {
"code": "ERR_FETCH_FAILED",
"message": "Network error occurred"
}
}
fetch API with AbortController for timeout handling/api/urlValidator (10 seconds)formatError utility