The single server-to-server call that decides whether a challenge was really solved. Send the token and your secret key; trust only the response.
Call this from your backend after a protected form is submitted. It is a server-to-server call. Never expose your secret key in the browser.
Send a JSON body with two fields:
| Field | Required | Description |
|---|---|---|
secret | yes | Your secret key (aloscap_sec_…). |
token | yes | The token from the widget’s hidden input. response is accepted as an alias. |
{
"secret": "aloscap_sec_XXXXXXXXXXXX",
"token": "a1B2c3D4e5F6g7H8i9J0"
}
Always HTTP 200 with a JSON body. Check the success boolean:
// passed { "success": true } // failed { "success": false, "error-codes": ["invalid-token"] }
Grant access only when success is true. If the call fails or times out, treat it as not verified and fail closed.
| Code | Meaning |
|---|---|
missing-input | The secret or token field was empty or absent. |
invalid-secret | The secret key does not match any account. |
invalid-token | The token is unknown, already redeemed (tokens are single-use), or older than 5 minutes. Each verification needs a fresh token. |
Both use only the standard library. No third-party HTTP client needed.
import json, urllib.request def verify(secret, token): payload = json.dumps({"secret": secret, "token": token}).encode() req = urllib.request.Request( "https://alos.gg/api/aloscaptcha/siteverify", data=payload, headers={"Content-Type": "application/json"}, ) with urllib.request.urlopen(req) as r: result = json.load(r) return result.get("success", False)
import ("bytes"; "encoding/json"; "net/http") func verify(secret, token string) bool { body, _ := json.Marshal(map[string]string{ "secret": secret, "token": token, }) resp, err := http.Post( "https://alos.gg/api/aloscaptcha/siteverify", "application/json", bytes.NewReader(body), ) if err != nil { return false } defer resp.Body.Close() var out struct{ Success bool `json:"success"` } json.NewDecoder(resp.Body).Decode(&out) return out.Success }