Public APIs
Escape favicon

Escape

Security

An API for escaping different kind of queries.

Escape's website screenshot

About Escape

Escape is an API that escapes user-supplied strings for safe use in different contexts, with three methods: html (HTML escaping to prevent XSS), shell (UNIX Bourne shell escaping to prevent OS command injection), and path (UNIX path escaping to prevent directory traversal). It exposes these methods over HTTP, accepting a method and data parameter and returning a JSON response with an ok flag and the escaped data string.

It is aimed at developers who need to sanitize untrusted input before rendering it in HTML, passing it to shell commands, or using it in file paths, without implementing the escaping logic themselves. The project is a small, single-file (main.rb) open-source repository.

Key features

  • Escapes HTML strings to prevent XSS
  • Escapes UNIX shell strings to prevent OS command injection
  • Escapes UNIX path strings to prevent directory traversal
  • Accessible via simple HTTP GET API calls with method and data parameters

Frequently asked questions

What does this API do?

It escapes HTML, shell, and path query strings to help prevent XSS, OS command injection, and directory traversal attacks.

How do you call the API?

You send a GET request with a method parameter (html, shell, or path) and a data parameter containing the string to escape.

What format does the API return?

It returns a JSON object with an ok boolean and a data field containing the escaped string.

Is this hosted somewhere I can use directly?

Yes, a hosted instance is available at s.polarspetroll.repl.co.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product