OpenCaptcha is an open source, free, public API that generates CAPTCHA images from text.
OpenCaptcha provides:
- A free, public API at api.opencaptcha.io.
- Documentation at opencaptcha.io.
- Self-hosting support (see the Installation section).
curl -X 'POST' \
'https://api.opencaptcha.io/captcha' \
-H 'Content-Type: application/json' \
-d '{ "text": "captcha" }'
curl -X 'POST' \
'https://api.opencaptcha.io/captcha' \
-H 'Content-Type: application/json' \
-d '{ "text": "普通" }'
curl -X 'POST' \
'https://api.opencaptcha.io/captcha' \
-H 'Content-Type: application/json' \
-d '{
"text": "hello world",
"theme": {
"primaryColor": "#ADD8E6",
"secondaryColor": "#FFFFFF"
}
}'
- Docker
- From the root folder of the project, run the following commands:
docker build -t opencaptcha -f ./src/Captcha.WebApi/Dockerfile . docker run -it -p 5280:8080 opencaptcha
- The API can be accessed at http://localhost:5280.
- Visual Studio 2022
- With ASP.NET and web development installed from the Visual Studio Installer
- .NET 9 SDK
- Open the solution in Visual Studio 2022.
- Build and launch the Captcha.WebApi project.
- The API can be accessed at https://localhost:5280.
- Open the solution in Visual Studio 2022.
- Run the tests in Test Explorer.
A significant portion of this project, especially the CAPTCHA generation code, is inspired by work originally published on February 9, 2004, by BrainJar.
Pull requests are accepted.