CAPTCHA API Documentation

This API provides endpoints for generating CAPTCHA images with configurable parameters and verifying user input against stored CAPTCHA values.

Base URL

http://localhost:5000

Generate CAPTCHA

Endpoint: /captcha
Method: GET, POST

Generates a CAPTCHA image. If no input data is provided, default CAPTCHA settings are applied. If JSON data is present, the CAPTCHA is generated using the supplied configuration.

Example JSON Input

{
  "length": 6,
  "size": [200, 70],
  "color": "black",
  "lines": 50,
  "dots": 300,
  "distort": "wave"
}

Supported Parameters

Parameter Type Description
length integer Number of characters in the CAPTCHA
size array Image size as [width, height]
color string or array Text color or multicolor option
lines integer Number of noise lines
dots integer Number of noise dots
distort string none, wave, shear, blur

CAPTCHA Examples

The following examples illustrate CAPTCHA images generated using different distortion modes.

No Distortion

distort = "none" CAPTCHA without distortion

Wave Distortion

distort = "wave" Wave distorted CAPTCHA

Shear Distortion

distort = "shear" Shear distorted CAPTCHA

Blur Effect

distort = "blur" Blurred CAPTCHA

Verify CAPTCHA

Endpoint: /verify
Method: GET

Example Request

/verify?uid=abc123&guess=K7P9Q

Possible Responses