{"openapi":"3.1.0","info":{"title":"Escape API","version":"1.0.0","description":"Escape a string so it is safe to drop into a specific context. Pick a target — a regular expression (so the text matches literally), a shell command (POSIX single-quote wrapping), a JSON string, a CSV field (RFC 4180 quoting) or a SQL string literal — and get back the correctly escaped value, plus a short note on the rule applied. The contexts endpoint lists every target with a worked example. Perfect for code generation, building commands and queries, templating and data export, and safely interpolating user input. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. The SQL context is a quoted literal for convenience, not a replacement for parameterised queries. Distinct from base64/hex/URL/HTML-entity encoders.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/escape-api","description":"oanor gateway"}],"tags":[{"name":"Escape"},{"name":"Reference"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/escape":{"get":{"operationId":"get_v1_escape","tags":["Escape"],"summary":"Escape for a context","description":"","parameters":[{"name":"text","in":"query","required":true,"description":"String to escape","schema":{"type":"string"},"example":"O'Brien, a.b*"},{"name":"context","in":"query","required":true,"description":"regex|shell|json|csv|sql","schema":{"type":"string"},"example":"regex"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Backslash-escapes regex metacharacters so the text matches literally.","input":"O'Brien, a.b*","context":"regex","escaped":"O'Brien, a\\.b\\*"},"meta":{"timestamp":"2026-06-03T01:09:42.529Z","request_id":"3558c5df-1cce-4837-bae6-cd30841f7bd3"},"status":"ok","message":"Escape for a context","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/contexts":{"get":{"operationId":"get_v1_contexts","tags":["Reference"],"summary":"Supported contexts","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"contexts":[{"name":"regex","note":"Backslash-escapes regex metacharacters so the text matches literally.","example":{"input":"O'Brien, a.b*","escaped":"O'Brien, a\\.b\\*"}},{"name":"shell","note":"POSIX single-quote wrapping — safe to drop into a sh/bash command.","example":{"input":"O'Brien, a.b*","escaped":"'O'\\''Brien, a.b*'"}},{"name":"json","note":"A JSON string literal, including the surrounding double quotes.","example":{"input":"O'Brien, a.b*","escaped":"\"O'Brien, a.b*\""}},{"name":"csv","note":"RFC 4180 — quotes the field only if it contains a comma, quote or newline.","example":{"input":"O'Brien, a.b*","escaped":"\"O'Brien, a.b*\""}},{"name":"sql","note":"A single-quoted SQL string literal. NOT a substitute for parameterised queries / prepared statements — prefer bound parameters to prevent SQL injection.","example":{"input":"O'Brien, a.b*","escaped":"'O''Brien, a.b*'"}}]},"meta":{"timestamp":"2026-06-03T01:09:42.625Z","request_id":"14f62a8e-c932-424d-8309-ab87f6619ac1"},"status":"ok","message":"Supported contexts","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"Escape API","notes":"The sql context produces a quoted literal but is not a substitute for parameterised queries — use bound parameters for untrusted input. For base64/hex/URL/HTML-entity encoding use an encoding API. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/escape","params":{"text":"the string (required)","context":"regex|shell|json|csv|sql (required)"},"returns":"the escaped string"},{"path":"/v1/contexts","params":[],"returns":"the supported contexts with examples"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Escape a string so it is safe to embed in a given context — a regular expression (literal match), a shell command (POSIX), a JSON string, a CSV field (RFC 4180) or a SQL string literal. Pure local, no key."},"meta":{"timestamp":"2026-06-03T01:09:42.700Z","request_id":"86bc7224-a1db-4a29-8c71-8384a44793ba"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":1085,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":125,"monthly_call_quota":9250,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2115,"monthly_call_quota":143500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5915,"monthly_call_quota":760000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/escape-api"}