Skip to content

feat(integrations): add Odds-API.io block and tools - #10422

Open
odds-api-io wants to merge 2 commits into
simstudioai:stagingfrom
odds-api-io:feat/odds-api-io-integration
Open

odds-api-io wants to merge 2 commits into
simstudioai:stagingfrom
odds-api-io:feat/odds-api-io-integration

Conversation

@odds-api-io

Copy link
Copy Markdown

Summary

Adds an Odds-API.io integration: a block with 13 read-only operations backed by apps/sim/tools/odds_api_io, a saved API-key credential (token service account verified against GET /v3/bookmakers/selected), the icon, the generated catalog/docs artifacts and a docs page with a hand-written intro.

Operations: Get Events, Search Events, Get Event, Get Event Odds, Get Multi Odds, Get Value Bets, Get Dropping Odds, Get Arbitrage Bets, Get Historical Events, Get Closing Lines, Get Sports, Get Leagues, Get Bookmakers. Every tool maps to a documented https://api.odds-api.io/v3 endpoint (OpenAPI: https://api.odds-api.io/v3/docs/doc.json) and declares effect: 'read'.

Product update (if relevant)

Anyone building sports or betting-data workflows can now pull pre-match and live odds from 500+ bookmakers across 37 sports, compare prices across bookmakers, archive closing lines, and run the value-bet, dropping-odds and arbitrage scanners from a Sim block. Requires an Odds-API.io API key (https://odds-api.io/pricing). Docs page: apps/docs/content/docs/integrations/odds_api_io.mdx.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • bunx tsc --noEmit in apps/sim: clean
  • bun run generate (bun 1.4.4) and the full generated output is committed; the docs intro survives a regenerate
  • check-canvas-sentences --block=odds_api_io, check:bare-icons, check:tool-effects, check:tool-request-boundary, check:tool-param-reachability, check:sdk-names, check:integration-catalog, check:deployment-config, check:docs, check:icon-paths, check:icon-path-precision, check:fork-dependent-coverage, check:block-successors, apps/sim/scripts/check-block-registry.ts origin/staging: all pass
  • check:tool-registry-boundary: the 16 new modules pushed the blocks routes 2 modules past the allowed growth, so the baseline was re-recorded with --update-baseline (the only change in scripts/check-tool-registry-boundary.baseline.json is module counts)
  • vitest run blocks/blocks.test.ts tools/request-transport.test.ts lib/credentials/token-service-accounts/server.test.ts: 68 passed
  • Credential check verified against the live API: an invalid key answers 401 with {"error":"You need to provide a valid apiKey"}
  • Not run: a dry workflow run with a real key (sim workflows run --dry); reviewers with an Odds-API.io key may want to exercise Get Events and Get Event Odds once

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

@odds-api-io is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · Fix the discarded agent filters before merging.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change adds a bounded set of Odds-API.io reads for Sim workflows.

Fix the discarded agent filters before merging.

Findings

  1. P1 Agent filters are discarded ▶
  2. P2 Invalid JSON looks empty ▶

Summary

Adds Odds-API.io with 13 read-only operations, saved API-key credentials, SDK names, icons, and catalog/docs entries.

  • Sim workflows can read sports odds through an Odds-API.io block.
  • The registry boundary baseline records updated module counts.

odds-api-io explicitly described the deliberate boundary baseline count update; CLAUDE.md permits this exception.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Agent supplies status or all] --> B[Merge model and saved arguments]
  B --> C[Block parameter mapper]
  C --> D[Replace filters with canvas-only names]
  D --> E[Request omits requested filter]
Loading

Reviews (1) · Last reviewed commit: "feat(integrations): add Odds-API.io bloc..." · Reviewed by Greptile

Comment thread apps/sim/blocks/blocks/odds_api_io.ts Outdated
Comment on lines +337 to +338
status: operation === SEARCH_EVENTS ? searchStatus : params.status,
all: operation === GET_LEAGUES ? includeInactiveLeagues === true : undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Agent filters are discarded

Search Events exposes status to the model, but this mapper replaces it with searchStatus. Get Leagues exposes all, but the mapper replaces it with includeInactiveLeagues === true. When those canvas fields are unset, the model's status: 'live' or all: true is discarded. Agents can search upcoming events instead of live ones or omit leagues they asked to include.

Preserve the tool argument when its canvas counterpart is absent, or use the same parameter name on both surfaces.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 146ff9a. On a tool call the mapper now keeps the model's own status and all arguments and only falls back to the Search In dropdown or the Include Leagues Without Events switch when the model gave none; the canvas still uses the fields. Covered by apps/sim/blocks/blocks/odds_api_io.test.ts.

Comment thread apps/sim/tools/odds_api_io/utils.ts Outdated
Comment on lines +74 to +78
try {
data = JSON.parse(text)
} catch {
data = null
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Invalid JSON looks empty

readOddsApiIoJson returns null when JSON parsing fails. List operations turn that into an empty list with success: true; single-event operations return records filled with nulls. If the API sends an unreadable successful response, workflows mistake it for valid empty data and skip error branches and retries.

Throw a clear error for invalid or unexpectedly empty JSON instead.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 146ff9a. readOddsApiIoJson now throws "returned a response that is not valid JSON" for a successful response whose body is empty or unparseable instead of returning null, so list operations no longer turn it into an empty result. Covered by apps/sim/tools/odds_api_io/utils.test.ts.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant