String Escaper API
Escape or unescape a string for JSON, JavaScript, Java/C#, Python, regular expressions, CSV, SQL, POSIX shell or HTML attributes.
POST /api/v1/tools/string-escaperMCP string_escaperDeveloper ToolsEscape or unescape text for JSON, JavaScript, Java, C#, Python, regex, CSV, SQL, shell and HTML attributes, with clear errors for malformed escapes.
Input
Send these as a JSON object. Unknown fields are rejected.
- input
- The raw string to escape, or the escaped string to unescape. (string, required)
- format
- Target syntax. (string, one of json, javascript, java, python, regex, csv, sql, shell, html, required)
- mode
- escape or unescape. (string, one of escape, unescape, default "escape")
- quote
- When escaping, wrap the result in the format's usual quotes (json, javascript, java, python, sql, html). (boolean, default false)
- asciiOnly
- When escaping, write every non-ASCII character as \uXXXX (json, javascript, java, python). (boolean, default false)
curl https://pithlab.com/api/v1/tools/string-escaper \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"input":"She said \"hi\"\nthen left.","format":"json","quote":true}'Example response
{
"ok": true,
"result": {
"output": "\"She said \\\"hi\\\"\\nthen left.\""
}
}