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
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,19 @@ jobs:
bash scripts/gen_proto.sh
git diff --exit-code -- racehooks/grpc/_gen \
|| (echo "stubs out of date: run scripts/gen_proto.sh" && exit 1)

feed-catalog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Verify generated feed catalog is up to date
run: |
python scripts/gen_feed_catalog.py
git diff --exit-code -- racehooks/models/_feed_catalog.py \
|| (echo "feed catalog out of date: run scripts/gen_feed_catalog.py" && exit 1)
# TODO: also compare catalog/feed-catalog.json contentHash against the monorepo's published
# catalog. No public URL serves it yet (GET /v1/feeds requires auth), so this check is not
# possible until one exists.
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ this package is the idiomatic answer. Data covers Formula 1 and other series.
RaceHooks provides **predictive models and analytics for motorsport — race intelligence
delivered to your endpoint.** You subscribe to feeds; RaceHooks **pushes signed JSON to your
webhook URL** (no polling), or you can read an SSE stream. A REST API serves post-race model
outputs, telemetry analytics, and historical results from 1950 to present. This SDK gives you a
outputs and historical results from 1950 to present. This SDK gives you a
typed REST client, HMAC webhook verification, Pydantic event models, and an optional gRPC
streaming client.

Expand Down Expand Up @@ -83,15 +83,15 @@ rh.webhooks.deliveries(); rh.webhooks.rotate_secret(webhook_id); rh.webhooks.del

# Model outputs, data and history (decoded JSON `data`; plan-gated by the API)
rh.insights.get_race("2026-bahrain-r1"); rh.models.manifest(); rh.lines.get(race_id)
rh.data.get_race(race_id); rh.historical.results(2021, 22); rh.telemetry.get_race_summary(race_id)
rh.data.get_race(race_id); rh.historical.results(2021, 22)
rh.usage.current(); rh.usage.subscription()

for feed, payload in rh.stream(["events.race"]): # SSE, no webhook server
...
```

Fantasy, replay and webhook methods return typed Pydantic models; the data/insights/historical/
telemetry/models/lines/analytics/preview/strategy/usage namespaces return the decoded JSON `data`. On a non-2xx response the client raises
models/lines/analytics/preview/strategy/usage namespaces return the decoded JSON `data`. On a non-2xx response the client raises
`RaceHooksAPIError` (with `status_code` and `body`); auth failures raise `RaceHooksAuthError`.

## Verify every incoming payload (do NOT skip this)
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

<!-- version list -->

## Unreleased

### Breaking Changes

- Remove car telemetry client surface, following the API removal of `/v1/telemetry/*`,
`/v1/data/races/{raceId}/telemetry/*`, `/v1/data/races/{raceId}/summary` and the
`results.race-summary` webhook feed (racehooks#5025). Removed: `TelemetryNamespace` and
`client.telemetry`; `data.get_race_summary`, `data.get_race_telemetry_laps`,
`data.get_race_telemetry_stints`, `data.get_race_telemetry_aggression`; `RaceSummaryEvent` and
its `type == "race.summary.complete"` dispatch in `parse_event`.

## v0.7.0 (2026-10-29)

### Features
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enforced by the API: a call above your plan raises `RaceHooksAPIError` with
status 402 or 403.

The fantasy, session-replay and webhook methods return typed Pydantic models.
The data, historical, insights, telemetry, models, lines, analytics, preview,
The data, historical, insights, models, lines, analytics, preview,
strategy and usage namespaces return the decoded JSON `data` payload (`dict`
or `list`); field names are listed in the
[OpenAPI spec](https://api.racehooks.io/openapi.json).
Expand Down Expand Up @@ -94,17 +94,15 @@ rh.preview.upcoming() # next-session preview (detail depen
rh.strategy.preview_next(); rh.strategy.recap("2026-monaco-r5")
```

### Data, historical and telemetry
### Data and historical

```python
rh.data.list_drivers(search="ver", active=True)
rh.data.get_race("2026-bahrain-r1")
rh.data.get_race_telemetry_laps("2026-bahrain-r1", driver_id="max_verstappen", lap=12)
rh.data.get_season_standings(2026)

rh.historical.results(2021, 22) # 1950 to present
rh.historical.driver_career("lewis_hamilton")
rh.telemetry.get_lap_comparison("2026-bahrain-r1", 20)
rh.indycar.standings()
```

Expand Down Expand Up @@ -282,7 +280,6 @@ The `feed` discriminator is the canonical, hyphenated feed id:
| `events.race` | `RaceEvent` | `event`, `lap`, `utc` |
| `events.qualifying` | `QualifyingEvent` | `event`, `lap`, `utc` |
| `session.timing` | `SessionTimingEvent` | `utc`, `lap`, `total_laps`, `track_status` |
| `results.race-summary` | `RaceSummaryEvent` | `type`, `race_id`, telemetry summary fields |
| `analytics.*` | `AnalyticsStrategy`, `AnalyticsRaceOdds`, `AnalyticsTruePace`, `AnalyticsGapProjection`, `AnalyticsWinningMargin`, `AnalyticsRaceDuration`, `AnalyticsRacePreview`, `AnalyticsTireStrategy`, `AnalyticsTeamPoints`, `AnalyticsChampionshipProbability`, `AnalyticsQualifying`, `AnalyticsSectorPace`, `AnalyticsBattle`, `AnalyticsPitWindow`, `AnalyticsTrackConditions`, `AnalyticsPitQuality` | per-feed (see `racehooks.models.feeds`) |
| `weather.*` | `WeatherRainEvent` (rain-onset + rain-cleared), `WeatherForecastUpdate`, `WeatherTireMismatch`, `WeatherStrategyDivergence`, `WeatherCompoundCrossover` | per-feed |
| anything else | `WebhookEvent` | — |
Expand Down
Loading
Loading