Verylot API
La API de Verylot da a los miembros cualquier dígito pasado con su prueba. Cada endpoint requiere una solicitud firmada con tu clave de API.
Conceptos básicos
- URL base:
https://api.verylot.online; todas las rutas empiezan por/v1. - Hora: todo está en UTC. Las horas siguen ISO 8601 (
2026-10-07T06:00:00Z). - Slots: el tiempo se divide en slots de 10 segundos,
slot = unix_seconds / 10. Un dígito por slot; el slot 179135280 es 2026-10-07 06:00:00 UTC. - Caché: los rangos terminados nunca cambian.
/v1/stream/blockenvíaCache-Control: public, max-age=600para ellos. - Coste: gratuito. Se aplican límites de uso justo (consulta Límites).
Endpoints
Cada endpoint con sus parámetros, una solicitud en varios lenguajes y una respuesta de ejemplo. Todos son para miembros y requieren solicitudes firmadas (ver Solicitudes firmadas más abajo).
Cómo comprobar una prueba paso a paso: Cómo funciona.
Solicitudes firmadas
Los endpoints de miembros usan un par de claves de API (Ed25519), no un secreto compartido:
- En el panel de miembro creas una clave. El par de claves se genera en tu navegador; Verylot solo guarda la clave pública. Tú conservas la clave privada (se muestra una sola vez o se descarga como archivo
.pem). También puedes pegar una clave pública que hayas generado tú mismo. →/panel/api-keys· paso a paso en la guía - Cada solicitud lleva cuatro cabeceras:
| Cabecera | Valor |
|---|---|
X-Verylot-Key |
el id de la clave, p. ej. vk_7Qm2xR9a |
X-Verylot-Timestamp |
la hora UTC actual; se acepta con un margen de ±5 minutos |
X-Verylot-Nonce |
16 bytes aleatorios, base64url; uno nuevo en cada solicitud |
X-Verylot-Signature |
base64 de la firma Ed25519 del texto siguiente |
El texto firmado son estas cinco líneas unidas con \n:
GET
/v1/stream?at=2026-10-07T06:00:00Z&digits=6
2026-10-07T10:15:00Z
q8Jm1Xb3oV0p9nW2rT5yZA
<hex SHA-256 of the request body; of an empty string for GET>
REQ='/v1/stream?at=2026-10-07T06:00:00Z&digits=6'
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
NONCE=$(openssl rand -base64 16 | tr '+/' '-_' | tr -d '=')
HASH=$(printf '' | sha256sum | cut -d' ' -f1)
printf 'GET\n%s\n%s\n%s\n%s' "$REQ" "$TS" "$NONCE" "$HASH" > signed.txt
SIG=$(openssl pkeyutl -sign -inkey verylot.pem -rawin -in signed.txt | base64 -w0)
curl "https://api.verylot.online$REQ" \
-H "X-Verylot-Key: vk_7Qm2xR9a" -H "X-Verylot-Timestamp: $TS" \
-H "X-Verylot-Nonce: $NONCE" -H "X-Verylot-Signature: $SIG"
import { createHash, createPrivateKey, randomBytes, sign } from 'node:crypto'
import { readFileSync } from 'node:fs'
const key = createPrivateKey(readFileSync('verylot.pem'))
const path = '/v1/stream?at=2026-10-07T06:00:00Z&digits=6'
const ts = new Date().toISOString().replace(/\.\d+Z$/, 'Z')
const nonce = randomBytes(16).toString('base64url')
const text = ['GET', path, ts, nonce, createHash('sha256').update('').digest('hex')].join('\n')
const signature = sign(null, Buffer.from(text), key).toString('base64')
const res = await fetch('https://api.verylot.online' + path, {
headers: {
'X-Verylot-Key': 'vk_7Qm2xR9a', 'X-Verylot-Timestamp': ts,
'X-Verylot-Nonce': nonce, 'X-Verylot-Signature': signature,
},
})
const result = await res.json()
import base64, datetime, hashlib, os
import requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key # pip install cryptography
key = load_pem_private_key(open('verylot.pem', 'rb').read(), None)
path = '/v1/stream?at=2026-10-07T06:00:00Z&digits=6'
ts = datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
nonce = base64.urlsafe_b64encode(os.urandom(16)).rstrip(b'=').decode()
text = '\n'.join(['GET', path, ts, nonce, hashlib.sha256(b'').hexdigest()])
signature = base64.b64encode(key.sign(text.encode())).decode()
result = requests.get('https://api.verylot.online' + path, headers={
'X-Verylot-Key': 'vk_7Qm2xR9a', 'X-Verylot-Timestamp': ts,
'X-Verylot-Nonce': nonce, 'X-Verylot-Signature': signature}).json()
// dotnet add package NSec.Cryptography (Ed25519)
using System.Security.Cryptography;
using System.Text;
using NSec.Cryptography;
var key = Key.Import(SignatureAlgorithm.Ed25519, File.ReadAllBytes("verylot.pem"), KeyBlobFormat.PkixPrivateKeyText);
var path = "/v1/stream?at=2026-10-07T06:00:00Z&digits=6";
var ts = DateTime.UtcNow.ToString("yyyy-MM-dd'T'HH:mm:ss'Z'");
var nonce = Convert.ToBase64String(RandomNumberGenerator.GetBytes(16)).TrimEnd('=').Replace('+', '-').Replace('/', '_');
var hash = Convert.ToHexStringLower(SHA256.HashData([]));
var text = string.Join('\n', "GET", path, ts, nonce, hash);
var signature = Convert.ToBase64String(SignatureAlgorithm.Ed25519.Sign(key, Encoding.UTF8.GetBytes(text)));
using var http = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.verylot.online" + path);
request.Headers.Add("X-Verylot-Key", "vk_7Qm2xR9a");
request.Headers.Add("X-Verylot-Timestamp", ts);
request.Headers.Add("X-Verylot-Nonce", nonce);
request.Headers.Add("X-Verylot-Signature", signature);
var response = await http.SendAsync(request);
// Ed25519 with PHP's built-in sodium; the PEM (PKCS#8) ends with the 32-byte seed.
$der = base64_decode(preg_replace('/-----[^-]+-----|\s/', '', file_get_contents('verylot.pem')));
$secret = sodium_crypto_sign_secretkey(sodium_crypto_sign_seed_keypair(substr($der, -32)));
$path = '/v1/stream?at=2026-10-07T06:00:00Z&digits=6';
$ts = gmdate('Y-m-d\TH:i:s\Z');
$nonce = rtrim(strtr(base64_encode(random_bytes(16)), '+/', '-_'), '=');
$text = implode("\n", ['GET', $path, $ts, $nonce, hash('sha256', '')]);
$signature = base64_encode(sodium_crypto_sign_detached($text, $secret));
$ch = curl_init('https://api.verylot.online' . $path);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-Verylot-Key: vk_7Qm2xR9a', "X-Verylot-Timestamp: $ts",
"X-Verylot-Nonce: $nonce", "X-Verylot-Signature: $signature",
],
]);
$result = json_decode(curl_exec($ch), true);
Una base de datos filtrada no puede firmar solicitudes en tu nombre, y una solicitud interceptada no puede reenviarse.
Errores
Los errores usan los detalles de problema de RFC 7807. code es estable; title se traduce al idioma de Accept-Language.
{ "status": 401, "code": "error.auth.signature-invalid", "title": "The request signature is missing or invalid." }
| Estado | Cuándo |
|---|---|
| 400 | entrada no válida |
| 401 | firma ausente o no válida — error.auth.signature-required, error.auth.signature-invalid, error.auth.timestamp-invalid, error.auth.nonce-reused, error.api-key.invalid |
| 403 | miembro no activo — error.tenant.inactive |
| 404 | no encontrado |
| 429 | límite alcanzado; consulta Retry-After |
Límites
Cada clave tiene un límite de solicitudes:
| Límite | Por defecto |
|---|---|
| Solicitudes a la API por minuto (por clave) | 10 |
Si necesitas más, escríbenos desde la página de contacto.
Solo las solicitudes firmadas correctamente cuentan para el límite de una clave. Los intentos fallidos (clave desconocida, firma incorrecta, marca de tiempo antigua, nonce reutilizado) se cuentan por IP: 30 en un minuto bloquean esa IP durante 15 minutos (429 con Retry-After).
Herramientas
- Verificador:
@verylot/verifierrecalcula y comprueba cualquier rango de dígitos, en el navegador o desde la línea de comandos:
verylot-verify --file verylot-proof.json
verylot-verify --api https://api.verylot.online --key vk_7Qm2xR9a --pem verylot.pem --at 2026-10-05T12:00:00Z --digits 6
- OpenAPI: la descripción legible por máquina de esta API:
https://api.verylot.online/openapi/v1.json.