Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/docs/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ export function HiggsfieldIcon(props: HiggsfieldIconProps) {
)
}

export function OddsApiIoIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} viewBox='0 0 48 48' fill='none' xmlns='http://www.w3.org/2000/svg'>
<rect x='4' y='15' width='6' height='18' rx='3' fill='currentColor' opacity='0.5' />
<rect x='13' y='11' width='6' height='26' rx='3' fill='currentColor' opacity='0.75' />
<rect x='22' y='5' width='6' height='38' rx='3' fill='currentColor' />
<rect x='31' y='11' width='6' height='26' rx='3' fill='currentColor' opacity='0.75' />
<rect x='40' y='15' width='6' height='18' rx='3' fill='currentColor' opacity='0.5' />
</svg>
)
}

export function EnrichmentIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/components/ui/icon-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ import {
NoteIcon,
NotionIcon,
ObsidianIcon,
OddsApiIoIcon,
OktaIcon,
OnePasswordIcon,
OpenAIIcon,
Expand Down Expand Up @@ -645,6 +646,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
notion_v2: NotionIcon,
obsidian: ObsidianIcon,
oci: OracleIcon,
odds_api_io: OddsApiIoIcon,
okta: OktaIcon,
okta_v2: OktaIcon,
onedrive: MicrosoftOneDriveIcon,
Expand Down
1 change: 1 addition & 0 deletions apps/docs/content/docs/integrations/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"notion",
"notion-service-account",
"obsidian",
"odds_api_io",
"okta",
"onedrive",
"onepassword",
Expand Down
31 changes: 31 additions & 0 deletions apps/docs/content/docs/integrations/odds_api_io.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Odds-API.io
description: Sports odds from 500+ bookmakers across 37 sports
integration:
type: "odds_api_io"
color: "#C964CF"
---


{/* MANUAL-CONTENT-START:intro */}
[Odds-API.io](https://odds-api.io) provides pre-match and live sports odds from 500+ bookmakers across 37 sports, with events, results, closing lines and odds scanners behind one REST API.

With the Odds-API.io block, you can:

- **Find events**: List the events of a sport or league for a date range, search them by team or league name, or read one event with its status and scores.
- **Compare odds**: Fetch the current odds of one event, or up to 10 events at once, from up to 30 bookmakers, every market included.
- **Pull history**: List finished events with final scores and sweep the closing lines of whole leagues over a season.
- **Run the scanners**: Get value bets for a bookmaker, selections whose odds dropped the most since opening or over the last 12, 24 or 48 hours, and arbitrage opportunities across bookmakers.
- **Look up reference data**: List the supported sports, leagues and bookmakers to get the exact slugs and names the other operations filter by.

Copy the API key from your [Odds-API.io dashboard](https://odds-api.io/dashboard) and connect it as a saved Odds-API.io account in Sim. Which bookmakers a key can query depends on the plan; see the [API documentation](https://docs.odds-api.io) for endpoints, markets and limits.

In Sim, the Odds-API.io block lets your agents alert on line movements, build odds comparison sheets, archive closing lines for analysis and answer questions about upcoming fixtures.
{/* MANUAL-CONTENT-END */}


## Use the block [#usage-instructions]

Pre-match and live sports odds from 500+ bookmakers across 37 sports. List sports, leagues and events, fetch odds for one or many events, pull historical results and closing lines, and run the value-bet, dropping-odds and arbitrage scanners.


89 changes: 89 additions & 0 deletions apps/sim/blocks/blocks/odds_api_io.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { describe, expect, it } from 'vitest'
import { OddsApiIoBlock } from '@/blocks/blocks/odds_api_io'

const mapParams = OddsApiIoBlock.tools.config?.params
if (!mapParams) throw new Error('Odds-API.io block has no params mapper')

/** Runs the mapper the way an Agent tool call does: its result is spread over the merged args. */
function toolCall(args: Record<string, unknown>, operation: string) {
return { ...args, ...mapParams(args, { operation }) }
}

/** Runs the mapper the way the canvas does: no context, the block's own operation input. */
function canvas(args: Record<string, unknown>, operation: string) {
return { ...args, ...mapParams({ ...args, operation }, undefined) }
}

describe('OddsApiIoBlock params mapper', () => {
it('lets the model pick the search status over the dropdown on a tool call', () => {
expect(
toolCall(
{ searchStatus: 'upcoming', status: 'live', query: 'Arsenal' },
'odds_api_io_search_events'
)
).toMatchObject({ status: 'live' })
expect(
toolCall({ searchStatus: 'live', query: 'Arsenal' }, 'odds_api_io_search_events')
).toMatchObject({ status: 'live' })
})

it('uses the dropdown on the canvas and the free-text status for Get Events', () => {
expect(
canvas({ searchStatus: 'live', query: 'Arsenal' }, 'odds_api_io_search_events')
).toMatchObject({ status: 'live' })
expect(
canvas(
{ searchStatus: 'live', sport: 'football', status: 'pending,live' },
'odds_api_io_get_events'
)
).toMatchObject({
status: 'pending,live',
})
})

it('lets the model include inactive leagues when the switch is off', () => {
expect(toolCall({ sport: 'football', all: true }, 'odds_api_io_get_leagues')).toMatchObject({
all: true,
})
expect(
toolCall({ sport: 'football', includeInactiveLeagues: false }, 'odds_api_io_get_leagues').all
).toBeUndefined()
expect(
canvas({ sport: 'football', includeInactiveLeagues: true }, 'odds_api_io_get_leagues')
).toMatchObject({ all: true })
expect(canvas({ sport: 'football', all: true }, 'odds_api_io_get_leagues').all).toBeUndefined()
})

it('keeps model-provided filters that share the tool param name', () => {
expect(
toolCall(
{
sport: 'football',
timeWindow: '24h',
minDrop: '12.5',
limit: '20',
page: 2,
includeEventDetails: false,
},
'odds_api_io_get_dropping_odds'
)
).toMatchObject({
timeWindow: '24h',
minDrop: 12.5,
limit: 20,
page: 2,
includeEventDetails: false,
})
expect(toolCall({ bookmaker: 'Bet365' }, 'odds_api_io_get_value_bets')).toMatchObject({
includeEventDetails: true,
})
})

it('drops fields that do not belong to the operation', () => {
const result = toolCall({ sport: 'football', limit: '5', page: '3' }, 'odds_api_io_get_events')
expect(result).toMatchObject({ limit: 5 })
expect(result.page).toBeUndefined()
expect(result.searchStatus).toBeUndefined()
expect(result.includeInactiveLeagues).toBeUndefined()
})
})
Loading