A lightweight Captcha API made with Flask. This version is a new, fast and completely rewritten API, originally by Vixen, which was discontinued.
The API is live at PythonAnywhere (specifically, here).
Simply make a HTTP get request to the API endpoint and treat it like a JSON.
import requests
response = requests.get('https://captchaAPI.pythonanywhere.com/api/img').json()
print(response["solution"], response["url"])
or, if you'd like a async request
import aiohttp
import asyncio
async def main():
async with aiohttp.ClientSession() as session:
async with session.get('https://captchaAPI.pythonanywhere.com/api/img') as responseget:
return await responseget.json()
loop = asyncio.get_event_loop()
response = loop.run_until_complete(main())
print(response["solution"], response["url"])
For more examples check out https://captchaAPI.pythonanywhere.com/examples !
For contributing please check out CONTRIBUTING.md
Method:
get
Return Type:
text / json
Description:
URL (CDN) of the captcha and it's solution.
- requests
Type:
number
Default Value | Max Value:
10 | 20
Description:
The number of how many times the image can be accessed before it expires.
Method:
get
Return Type:
image
Description:
An image (the captcha).