API Documentation

Convert any image to ASCII art with a single HTTP request.
Free, no API key required.

Endpoints

POST/api/convert

Image → ASCII art (text, html, svg, json, animated)

POST/api/text

Text → ASCII art (FIGlet fonts)

GET/api/convert

Returns usage info, parameters, limits, and examples (JSON)

GET/api/text

Returns usage info, available fonts, and examples (JSON)

Base URL: https://yourascii.vercel.app

Open any GET endpoint in your browser to see all available options.

CLI Tool

Use yourascii directly from the terminal. No curl syntax needed.

Install

curl -O https://yourascii.vercel.app/cli.js

Usage

# Show all commands and options
node cli.js --help

# Text to ASCII
node cli.js text "HELLO"
node cli.js text "GG" --font Doom
node cli.js text "WOW" --font Big --format html -o banner.html

# Image to ASCII
node cli.js convert photo.png
node cli.js convert photo.png --resolution 100 --colorMode colored
node cli.js convert photo.png --format svg -o output.svg

Requires: Node.js 18+ (with built-in fetch)

Available fonts: Standard, Banner, Big, Block, Doom, Lean, Mini, Script, Shadow, Slant, Small, Speed

Limits & Security

LimitValueWhat happens
Rate Limit30 req/min per IP429 with Retry-After header
File Size5 MB max413 Payload Too Large
Resolution10 – 300 columnsValues outside range are clamped
Text Length100 chars maxSilently truncated
URL Fetch Timeout10 seconds500 if remote server too slow

Security

  • SSRF Protection — Private IPs, localhost, and cloud metadata endpoints are blocked when using URL input.
  • Protocol Restriction — Only http:// and https:// URLs are accepted.
  • Input Validation — All parameters are validated and sanitized. Invalid values fall back to safe defaults.
  • No Authentication — The API is free and open. No API key needed.
  • CORS — All origins allowed (Access-Control-Allow-Origin: *).

Resolution Warning

We recommend keeping resolution at 120 or below for best results. Values above 150 generate huge outputs that may cause slow rendering or timeouts — especially with html, svg, and animated formats.

Sweet spot: 60–100 for most images.

/api/convert — Parameters

Two ways to send images:

File Upload

Content-Type: multipart/form-data

Send an image file as the image field.

Image URL

Content-Type: application/json

Send {"url": "https://..."} in the body.

ParamTypeDefaultDescription
resolutionnumber80Columns (10–300). Higher = more detail.
colorModestringmonomono | colored | matrix
backgroundstringdarkdark | light
invertedbooleanfalseInvert the character brightness.
formatstringtexttext | html | svg | animated | json

/api/text — Parameters

Convert text into large ASCII banners using FIGlet fonts. Send as application/json.

ParamTypeDefaultDescription
textstringText to convert (required, max 100 chars)
fontstringStandardFIGlet font name (see list below)
formatstringtexttext | html | json
colorstring#fffCSS color for HTML output

Available Fonts:

Standard, Banner, Big, Block, Doom, Lean, Mini, Script, Shadow, Slant, Small, Speed

Response Formats

text

Raw ASCII art as plain text.

text/plain

html

Full-page HTML with colored spans.

text/html

svg

Scalable vector graphic. Great for logos.

image/svg+xml

animated

Line-by-line typewriter reveal.

text/html

json
{ "text": "...",
  "meta": { "cols": 80, "rows": 48 } }

application/json

Code Examples

cURL — File Upload

curl -X POST https://yourascii.vercel.app/api/convert \
  -F "image=@photo.png" \
  -F "resolution=100" \
  -F "colorMode=mono"

cURL — Image URL (colored HTML)

curl -X POST https://yourascii.vercel.app/api/convert \
  -H "Content-Type: application/json" \
  -d '{"url": "https://i.imgur.com/your-image.jpg", "resolution": 80, "colorMode": "colored", "format": "html"}' \
  -o output.html

cURL — Text to ASCII

curl -X POST https://yourascii.vercel.app/api/text \
  -H "Content-Type: application/json" \
  -d '{"text": "HELLO", "font": "Doom"}'

JavaScript (fetch)

const form = new FormData();
form.append("image", fileInput.files[0]);
form.append("resolution", "100");

const res = await fetch("https://yourascii.vercel.app/api/convert", {
  method: "POST",
  body: form,
});
const asciiText = await res.text();
console.log(asciiText);

Python (requests)

import requests

with open("photo.png", "rb") as f:
    r = requests.post(
        "https://yourascii.vercel.app/api/convert",
        files={"image": f},
        data={"resolution": "100", "colorMode": "colored", "format": "json"},
    )
print(r.json())

SVG Output

curl -X POST https://yourascii.vercel.app/api/convert \
  -F "image=@photo.png" \
  -F "format=svg" -o output.svg

Animated HTML

curl -X POST https://yourascii.vercel.app/api/convert \
  -F "image=@photo.png" \
  -F "format=animated" -o animated.html

Use Cases

Real-world ways developers use the yourascii API:

Website — Greet users with ASCII art

<!-- Add this to any HTML page -->
<input id="name" placeholder="Your name..." />
<button onclick="greet()">Generate</button>
<pre id="result" style="font-family:monospace"></pre>

<script>
async function greet() {
  const name = document.getElementById("name").value;
  const res = await fetch("https://yourascii.vercel.app/api/text", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ text: "Hello " + name, font: "Doom" }),
  });
  document.getElementById("result").textContent = await res.text();
}
</script>

Discord Bot — Convert images to ASCII

// Node.js Discord bot example
client.on("messageCreate", async (msg) => {
  if (msg.attachments.size > 0) {
    const imageUrl = msg.attachments.first().url;
    const res = await fetch("https://yourascii.vercel.app/api/convert", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ url: imageUrl, resolution: 50 }),
    });
    const ascii = await res.text();
    msg.reply("```\n" + ascii + "\n```");
  }
});

GitHub README — Generate ASCII banners

# Generate a banner for your README
curl -X POST https://yourascii.vercel.app/api/text \
  -H "Content-Type: application/json" \
  -d '{"text": "My Project", "font": "Big"}'

# Output:
#  __  __         ____            _           _
# |  \/  |_   _  |  _ \ _ __ ___ (_) ___  ___| |_
# | |\/| | | | | | |_) | '__/ _ \| |/ _ \/ __| __|
# | |  | | |_| | |  __/| | | (_) | |  __/ (__| |_
# |_|  |_|\__, | |_|   |_|  \___// |\___|\___|\___|
#          |___/                |__/

Python — Batch convert a folder

import requests, os

for filename in os.listdir("./photos"):
    with open(f"./photos/{filename}", "rb") as f:
        r = requests.post(
            "https://yourascii.vercel.app/api/convert",
            files={"image": f},
            data={"resolution": "80", "format": "html"},
        )
    with open(f"./output/{filename}.html", "w") as out:
        out.write(r.text)
    print(f"Converted {filename}")

React / Next.js — Live ASCII preview

const [ascii, setAscii] = useState("");

async function handleUpload(file) {
  const form = new FormData();
  form.append("image", file);
  form.append("resolution", "60");
  form.append("colorMode", "colored");
  form.append("format", "html");

  const res = await fetch("https://yourascii.vercel.app/api/convert", {
    method: "POST", body: form,
  });
  setAscii(await res.text());
}

return <div dangerouslySetInnerHTML={{ __html: ascii }} />;

Error Codes

CodeMeaningExample
400Bad RequestMissing image, invalid URL, blocked URL (SSRF)
413Payload Too LargeFile exceeds 5 MB limit
429Too Many RequestsRate limit exceeded (30/min). Check Retry-After header.
500Server ErrorInvalid image format or processing failure