Server Verify API

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.

Endpoint

POST https://alos.gg/api/aloscaptcha/siteverify

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.

Request

Send a JSON body with two fields:

FieldRequiredDescription
secretyesYour secret key (aloscap_sec_…).
tokenyesThe token from the widget’s hidden input. response is accepted as an alias.
json
{
    "secret": "aloscap_sec_XXXXXXXXXXXX",
    "token":  "a1B2c3D4e5F6g7H8i9J0"
}

Response

Always HTTP 200 with a JSON body. Check the success boolean:

json
// 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.

Error Codes

CodeMeaning
missing-inputThe secret or token field was empty or absent.
invalid-secretThe secret key does not match any account.
invalid-tokenThe token is unknown, already redeemed (tokens are single-use), or older than 5 minutes. Each verification needs a fresh token.

Code Examples

Both use only the standard library. No third-party HTTP client needed.

Python (standard library)

python
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)

Go (standard library)

go
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
}