NuroPicks.com

BookSync developer reference

One-page complete reference for integrating with or contributing to the BookSync extension. If you only want to install it, the install guide is shorter. If you want the threat model, security is the page.

Architecture in 30 seconds

  1. User mints a personal token at /account/booksync. Plaintext shown once; SHA-256 stored on the server.
  2. User installs the Chrome extension (developer mode today, Web Store soon).
  3. User logs into a sportsbook in the same Chrome profile. No credentials ever touch the extension.
  4. User opens the book's bet-history page and clicks Sync.
  5. The per-book content script reads visible HTML, normalizes each row to the canonical schema, and POSTs to /api/account/booksync/import with the token in the Authorization header.
  6. Server upserts on (user_id, book, external_id). Re-running sync is idempotent.

Authentication

Bearer token in the Authorization header. Format:

Authorization: Bearer np_bs_<32 hex>

Tokens are per-device. Lose a laptop, revoke that token at /account/booksync. Other devices keep working.

Canonical bet payload

Every per-book scraper normalizes to this shape before POSTing. Schema lives in 0038-booksync-keys-and-attribution.sql.

FieldTypeReqNotes
external_idstringyesBook's own bet/entry/ticket id. Server-side dedup key. Re-running sync is safe.
bookstringyesOne of: draftkings, fanduel, betmgm, caesars, espn-bet, betrivers, fanatics, hardrock, prizepicks, underdog.
placed_atiso8601yesWhen the bet was placed. Book-provided when available, otherwise scrape ts.
sportstringnoLowercase token: nfl, nba, mlb, nhl, ncaaf, ncaab, mma, soccer, tennis, golf.
gamestringnoFree-form. "DAL @ NYG" / "Chiefs vs Eagles". For DFS lineups, the slate name.
marketstringnoFree-form. "spread", "moneyline", "player_points_o22.5". DFS uses the prop type.
pick_textstringnoHuman-readable. "Eagles -3.5", "Mahomes Over 285.5 yds".
odds_americanintnoSigned. -110, +145. Omit for DFS entries that price by payout multiplier.
stake_centsintyesStake in cents. $10 = 1000.
potential_win_centsintnoNet potential profit in cents. Omit if unknown; server can compute from odds + stake.
resultenumyespending | win | loss | push | void.
settled_atiso8601noWhen the bet settled. Required if result is not pending.

Public endpoint catalog

Six endpoints, no auth, CORS-open. Drop-in for dashboards, uptime monitors, and partner integrations. OpenAPI 3.1 fragment at /api/booksync/openapi.json.

PathCacheDescription
/api/booksync/stats60 sAdoption metrics. Total + active keys, distinct users, total bets imported, books live, 7d/30d windows, per-book breakdown.
/api/booksync/books5 minPer-book scraper inventory. version, ring origin, host permissions, GitHub source URL, rot risk, last-verified-against-live-DOM ts.
/api/booksync/health30 sSystem health probe. DB reachability, key/bets table presence, latency, endpoint inventory. Used by uptime monitors.
/api/booksync/version60 sLatest extension version + upgrade hint. Polled by the popup at startup.
/api/booksync/recent5 minAnonymized 30d feed of imports. PII-stripped: book + sport + market + stake bucket + result + days ago. ?limit=50 (max 200).
/api/booksync/openapi.json30 minOpenAPI 3.1 fragment for the 5 public endpoints. Lets Postman / Insomnia / openapi codegen introspect without scraping the dev hub.

Error codes

What the auth-gated import endpoint returns and what to do about it.

StatusMeaning
200Import accepted. Body contains imported / deduped / skipped counts.
400Payload validation failed. Body lists which row was malformed.
401Token missing or wrong format.
403Token revoked or never minted on this account.
404Resource not found (only on GET endpoints with path params).
413Payload too large. Cap is 5000 rows per import call.
429Rate limited. 30 imports per token per hour.
5xxServer-side. Retry with exponential backoff. /api/booksync/health will tell you if DB is down.

Contributing

Per-book scraper PR guide lives at CONTRIBUTING.md. Selector strategy + rot-risk ranking at SCRAPER-AUDIT.md. Submission package for the Chrome Web Store at CHROME-WEB-STORE-SUBMISSION.md.

Surface map

Vault Ring 525. 21+ only. Not financial advice. 1-800-GAMBLER.

Must be 21+. Gambling problem? Call 1-800-GAMBLER. NJ/PA: 1-800-GAMBLER · MI: 1-800-270-7117 · VA: 1-888-532-3500 · CO: 1-800-522-4700 · NY: 877-846-7369 (HOPENY).

NuroPicks LLC · 30 N Gould St Ste R, Sheridan, WY 82801