Reference
API Documentation
Sharp-line +EV opportunities, settled history, auth, and package purchase — served over a clean REST surface that matches the scanner you already use in the product UI.
Introduction
Everything hangs off one host: http://localhost:3000. Read every path below as relative to it, and expect JSON back on every call.
Browser sessions use an httpOnly cookie after login/register. Once signed in, call the /api/v1/* endpoints from the same origin — the cookie is sent automatically.
Authentication
Sign in or register first, then reuse the session cookie on protected routes.
POST /api/auth/registerorPOST /api/auth/login- Server sets
vb_session(httpOnly JWT, 14 days) - Call
/api/v1/value-bets,/api/v1/settled, or package purchase with that cookie
# Register, keep cookies, then list value bets
curl -c cookies.txt -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"secret1","name":"You"}'
curl -b cookies.txt "http://localhost:3000/api/v1/value-bets?sport=Soccer&min_ev=5"Errors
| Status | Error code | When it happens |
|---|---|---|
| 401 | missing_session | No signed-in cookie on a protected route |
| 401 | — | Invalid email/password on login |
| 400 | — | Validation error (weak password, unknown plan, duplicate email) |
| 404 | — | Account missing during purchase |
| 500 | server_error | Database or unexpected failure |
{
"error": "missing_session",
"message": "Sign in to call this endpoint."
}Rate limits
Quotas are plan-oriented (product tiers). Hard HTTP throttling is not enforced yet — treat these as the intended ceilings when you integrate bots.
| Plan | Price | Minute | Day | Value-bet feed |
|---|---|---|---|---|
| Starter | $99/mo | 30 | 2,000 | Soccer prematch |
| Pro | $499/mo | 60 | 10,000 | All sports + live |
| Elite | $999/mo | 120 | Unlimited* | All sports + live |
* Fair-use on Elite until hard limits ship.
/api/v1/value-betssessionValue bets
Returns the current +EV board from MySQL — the same rows powering the Scanner. Each bet includes soft-book odds, fair odds, sharp book, and a similar array for cross-book comparison.
Query parameters
| Name | Type | Description |
|---|---|---|
sport | string | Soccer, Basketball, or Tennis |
live | 0 | 1 | Filter live (1) or prematch (0) |
bookmaker | string | Exact bookmaker name, e.g. Bet365 |
min_ev | number | Minimum EV% using (odds / fairOdds - 1) * 100 |
curl -b cookies.txt \
"http://localhost:3000/api/v1/value-bets?sport=Soccer&min_ev=5&live=0"{
"count": 12,
"last": 1729410000000,
"bets": [
{
"id": "vb-001",
"sport": "Soccer",
"league": "Premier League",
"home": "Tottenham",
"away": "Coventry",
"bookmaker": "Marathon",
"odds": 2.34,
"fairOdds": 2.22,
"sharpBook": "Betfair",
"similar": [{ "bookmaker": "Bet365", "odds": 2.25 }]
}
]
}/api/v1/settledsessionSettled bets
Historical settled sample used by the Results page — win/loss, stake, and ROI inputs.
Query parameters
| Name | Type | Description |
|---|---|---|
sport | string | Optional sport filter |
result | win | loss | Optional outcome filter |
curl -b cookies.txt "http://localhost:3000/api/v1/settled?result=win"/api/auth/loginLogin
Exchange email and password for a session cookie.
curl -c cookies.txt -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"secret1"}'/api/auth/registerRegister
Create an account (password min 6 chars) and receive a session cookie.
curl -c cookies.txt -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"secret1","name":"You"}'/api/auth/mesessionCurrent user
Returns the signed-in user, including active planId when a package was purchased.
curl -b cookies.txt http://localhost:3000/api/auth/me/api/packages/checkoutsessionPurchase package
Creates a NOWPayments invoice for starter, pro, or elite. Pass network as trc20, bep20, or erc20 (maps to usdttrc20 / usdtbsc / usdterc20). Redirect the user to invoiceUrl. When NOWPayments confirms payment, POST /api/payments/nowpayments/ipn marks the order paid and sets users.plan_id.
curl -b cookies.txt -X POST http://localhost:3000/api/packages/checkout \
-H "Content-Type: application/json" \
-d '{"planId":"pro","network":"trc20"}'
# Response
# { "orderId": "...", "payCurrency": "usdttrc20", "invoiceUrl": "https://nowpayments.io/payment/?iid=..." }Configure NOWPAYMENTS_API_KEY and NOWPAYMENTS_IPN_SECRET. IPN cannot reach localhost — set a public NEXT_PUBLIC_APP_URL. See Packages.