Verylot API

Verylot API は、会員に過去の任意の数字をその証明とともに提供します。すべてのエンドポイントで、API キーで署名したリクエストが必要です。

基本事項

  • ベース URL: https://api.verylot.online — すべてのパスは /v1 で始まります。
  • 時刻: すべて UTC です。時刻は ISO 8601 形式(2026-10-07T06:00:00Z)です。
  • スロット: 時間は 10 秒ごとのスロットに分割されます:slot = unix_seconds / 10。1 スロットにつき数字は 1 つです。スロット 179135280 は 2026-10-07 06:00:00 UTC です。
  • キャッシュ: 終了した範囲は二度と変わりません。/v1/stream/block はそれらに対して Cache-Control: public, max-age=600 を送信します。
  • 料金: 無料です。公正利用のための制限が適用されます(制限 をご覧ください)。

エンドポイント

各エンドポイントのパラメーター、複数言語でのリクエスト例、レスポンス例です。すべて会員向けで、署名付きリクエストが必要です(下の 署名付きリクエスト を参照)。

証明を段階的に確認する方法:仕組み。

署名付きリクエスト

会員向けエンドポイントでは、共有シークレットではなく API キーペア(Ed25519)を使用します。

  1. 会員パネルでキーを作成します。キーペアは お使いのブラウザ内で 生成され、Verylot は公開鍵のみを保存します。秘密鍵はお客様が保管します(一度だけ表示されるか、.pem ファイルとしてダウンロードされます)。ご自身で生成した公開鍵を貼り付けることもできます。 → /panel/api-keys · ガイドで手順を確認
  2. すべてのリクエストには 4 つのヘッダーを付けます。
ヘッダー 値
X-Verylot-Key キー ID。例:vk_7Qm2xR9a
X-Verylot-Timestamp 現在の UTC 時刻。±5 分以内であれば受け付けられます
X-Verylot-Nonce 16 バイトのランダム値(base64url)。リクエストごとに新しい値
X-Verylot-Signature 以下のテキストに対する Ed25519 署名の base64

署名対象のテキストは、次の 5 行を \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);

データベースが漏洩しても、お客様に代わってリクエストに署名することはできません。また、傍受されたリクエストを再送することもできません。

エラー

エラーは RFC 7807 の problem details 形式を使用します。code は変わりません。title は Accept-Language の言語に翻訳されます。

{ "status": 401, "code": "error.auth.signature-invalid", "title": "The request signature is missing or invalid." }
ステータス 発生条件
400 無効な入力
401 署名がない、または無効 — error.auth.signature-required, error.auth.signature-invalid, error.auth.timestamp-invalid, error.auth.nonce-reused, error.api-key.invalid
403 会員が有効でない — error.tenant.inactive
404 見つからない
429 制限に到達。Retry-After をご覧ください

制限

キーごとにリクエスト数の上限があります。

制限 既定値
1 分あたりの API リクエスト数(キーごと) 10

さらに必要な場合は、お問い合わせページ からご連絡ください。

キーの上限に数えられるのは、正しく署名されたリクエストだけです。失敗した試行(不明なキー、不正な署名、古いタイムスタンプ、再利用された nonce)は IP ごとに数えられ、1 分間に 30 回でその IP は 15 分間ブロックされます(Retry-After 付きの 429)。

ツール

  • 検証ツール: @verylot/verifier は、ブラウザ上またはコマンドラインで、任意の範囲の数字を再計算して確認します。
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