shipp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseShipp API
Shipp API
Shipp.ai is the definitive source on real-time data.
Reference docs.
Implement as many tests as possible as soon as possible.
Verify data and how the app uses data.
Be flexible in schema — event rows are schema-flexible JSON and fields vary by sport, feed, and event.
Base prefix:
- All routes are under:
https://api.shipp.ai/api/v1
Documentation & References
文档与参考
All detailed examples, request/response schemas, and walkthroughs live in the official docs. Always consult these before building:
| Resource | URL |
|---|---|
| Full documentation | https://docs.shipp.ai |
| How-to guides | https://docs.shipp.ai/how-to/ |
| Setup instructions | https://docs.shipp.ai/instructions/setup/ |
| API reference | https://docs.shipp.ai/api-reference/ |
| Dashboard / Signup | https://platform.shipp.ai/signup |
| Billing management | https://platform.shipp.ai/billing |
所有详细示例、请求/响应 schema 和操作指南均在官方文档中。在开发前请务必查阅这些文档:
Authentication
身份验证
All endpoints require an API key. The API supports several ways to provide it:
| Method | Example |
|---|---|
Query parameter | |
Query parameter | |
| |
| |
| |
| |
| |
Pick whichever method works best for your client.
所有端点均需要API密钥。API支持多种提供密钥的方式:
| 方式 | 示例 |
|---|---|
查询参数 | |
查询参数 | |
| |
| |
| |
| |
| |
选择最适合你的客户端的方式即可。
Endpoints Overview
端点概述
Below is a summary of the available endpoints. For full request/response examples, schemas, and field descriptions see the API reference.
以下是可用端点的汇总。如需完整的请求/响应示例、schema和字段说明,请查看API参考。
POST /api/v1/connections/create
POST /api/v1/connections/createPOST /api/v1/connections/create
POST /api/v1/connections/createCreate a new raw-data connection by providing natural-language that describe what games, teams, sports, or events you want to track.
filter_instructionsReturns a (ULID) you'll reuse for all subsequent runs.
connection_id通过提供自然语言的(过滤指令)来创建新的原始数据连接,描述你想要追踪的赛事、球队、体育项目或事件。
filter_instructions返回一个(ULID格式),你在后续所有操作中都将复用该ID。
connection_id→ 完整文档与示例
POST /api/v1/connections/{connectionId}
POST /api/v1/connections/{connectionId}POST /api/v1/connections/{connectionId}
POST /api/v1/connections/{connectionId}Run a connection and receive raw event data.
Supports optional body fields for time-based filtering (), cursor-based pagination (), and result limiting ().
sincesince_event_idlimitGET /api/v1/connections
GET /api/v1/connectionsGET /api/v1/connections
GET /api/v1/connectionsList all connections in the current org scope.
列出当前组织范围内的所有连接。
→ 完整文档与示例
GET /api/v1/sports/{sport}/schedule
GET /api/v1/sports/{sport}/scheduleGET /api/v1/sports/{sport}/schedule
GET /api/v1/sports/{sport}/scheduleRetrieve upcoming and recent games for a given sport (past 24 hours through next 7 days).
Supported sport values: , , , , (case-insensitive).
nbanflmlbncaafbsoccerData Shape
数据结构
Event rows returned in are schema-flexible JSON objects. Fields vary by sport, feed, and event. Common field categories include:
data[]- IDs: ,
game_id,home_id,away_id,attribution_idposession_id - Text / enums: ,
sport,home_name,away_name,game_clock,desc,typecategory - Numeric: ,
home_points,away_points,game_period,down,yards_first_downlocation_yard_line - Time: ,
wall_clock_startwall_clock_end
Not every row has every field. Agents and clients should be defensive and handle missing keys.
For the complete field reference see docs.shipp.ai.
data[]- ID类:、
game_id、home_id、away_id、attribution_idposession_id - 文本/枚举类:、
sport、home_name、away_name、game_clock、desc、typecategory - 数值类:、
home_points、away_points、game_period、down、yards_first_downlocation_yard_line - 时间类:、
wall_clock_startwall_clock_end
并非每一行都包含所有字段。代理和客户端应采取防御性编程,处理缺失的键。
如需完整的字段参考,请查看docs.shipp.ai。
Error Format
错误格式
Errors are returned as JSON with an message, HTTP code, and a :
errorstatushint| Status | Meaning |
|---|---|
| 400 | Invalid request — check JSON and required fields |
| 401 | Missing or invalid API key |
| 402 | Billing changes required — manage at https://platform.shipp.ai/billing |
| 403 | API key lacks access to this resource |
| 404 | Connection not found or doesn't belong to your org |
| 429 | Rate-limited — retry with backoff |
| 5xx | Server error — retry later or contact support@shipp.ai |
错误以JSON格式返回,包含消息、HTTP状态码和提示信息:
errorstatushint| 状态码 | 含义 |
|---|---|
| 400 | 请求无效——检查JSON格式和必填字段 |
| 401 | 缺少或无效的API密钥 |
| 402 | 需要更改账单设置——请在https://platform.shipp.ai/billing管理 |
| 403 | API密钥无权访问该资源 |
| 404 | 连接不存在或不属于你的组织 |
| 429 | 请求受限——请稍后重试并使用退避策略 |
| 5xx | 服务器错误——请稍后重试或联系support@shipp.ai |
Response Compression
响应压缩
Include an header to receive compressed responses (, , or ). Compression is applied automatically when the response body exceeds 1 KB.
Accept-Encodingzstdgzipdeflate添加头即可接收压缩后的响应(支持、或)。当响应体超过1KB时,会自动应用压缩。
Accept-EncodingzstdgzipdeflateUsage Tips
使用技巧
- Keep short, explicit, and testable. Mention the sport/league and scope.
filter_instructions - Store and reuse — don't create a new connection per run. Creating connections has time and credit overhead.
connection_id - Use for efficient polling (cursor-based pagination). Send the lexicographically largest event ID you've received.
since_event_id - Use the schedule endpoint to discover s and team names before creating connections.
game_id - Surface error messages directly to users when limits are hit.
hint - Treat every field in as optional — use existence checks and graceful fallbacks.
data[] - Log unknown data shapes in development so you can refine .
filter_instructions - Polling interval: 5–30 seconds depending on domain and cost sensitivity.
- Deduplicate events by keeping a rolling set of seen event IDs.
- Consult the how-to guides for end-to-end integration walkthroughs.
- 保持简洁、明确且可测试。提及体育项目/联赛和范围。
filter_instructions - 存储并复用——不要每次运行都创建新连接。创建连接会消耗时间和额度。
connection_id - 使用实现高效轮询(基于游标分页)。发送你收到的字典序最大的事件ID。
since_event_id - 在创建连接前,使用日程端点发现和球队名称。
game_id - 当达到限制时,直接向用户展示错误的提示信息。
hint - 将中的每个字段视为可选字段——进行存在性检查并优雅降级。
data[] - 在开发环境中记录未知的数据结构,以便你优化。
filter_instructions - 轮询间隔:根据业务场景和成本敏感度设置为5-30秒。
- 通过维护一个已见过的事件ID滚动集合来实现事件去重。
- 查阅操作指南获取端到端的集成教程。
Integration Pattern: "Real-Time Contract"
集成模式:“实时契约”
When building a feature powered by Shipp, define a contract for each screen or agent loop:
- User promise — what must stay accurate while the user (or agent) is watching?
- Triggering events — what changes should cause UI updates or agent actions?
- Data shape needed — what fields do you need to render or decide?
- Freshness window — how old can the last update be before you warn the user?
- Failure mode — what do you show/do if updates stop arriving?
Then translate the contract into when creating the connection.
filter_instructions在构建基于Shipp的功能时,为每个界面或代理循环定义一个契约:
- 用户承诺——当用户(或代理)查看时,哪些内容必须保持准确?
- 触发事件——哪些变化应导致UI更新或代理操作?
- 所需数据结构——你需要哪些字段来渲染或做决策?
- 新鲜度窗口——最后一次更新的最大允许时长是多少,超过后需要提醒用户?
- 故障模式——如果更新停止,你要展示什么/做什么?
然后在创建连接时,将契约转换为。
filter_instructionsExample Project: Alph Bot
示例项目:Alph Bot
Alph Bot is an open-source automated trading bot that uses Shipp for real-time sports data and trades on prediction markets. It demonstrates a production-quality integration of the Shipp API.
Alph Bot是一个开源的自动交易机器人,它使用Shipp获取实时体育数据并在预测市场进行交易。它展示了Shipp API的生产级集成示例。
How Alph Bot Uses Shipp
Alph Bot如何使用Shipp
-
Game discovery — Usesto list available games:
GET /api/v1/sports/{sport}/schedule -
Connection creation — Creates a Shipp connection for a specific game, describing what events to track via.
filter_instructions -
Live polling — Runs the connection on an interval, usingfor cursor-based pagination to receive only new events since the last poll.
since_event_id -
AI analysis — Feeds the schema-flexibleevents directly to Claude AI, which analyzes game state and estimates outcome probabilities.
data[] -
Trading decisions — Compares AI-estimated probabilities against Kalshi market prices to find value bets.
-
赛事发现——使用列出可用赛事:
GET /api/v1/sports/{sport}/schedule -
创建连接——为特定赛事创建Shipp连接,通过描述要追踪的事件。
filter_instructions -
实时轮询——按间隔运行连接,使用进行基于游标分页,仅接收自上次轮询以来的新事件。
since_event_id -
AI分析——将schema灵活的事件直接输入Claude AI,由其分析赛事状态并估算结果概率。
data[] -
交易决策——将AI估算的概率与Kalshi市场价格进行比较,寻找有价值的投注机会。
Key Takeaways from Alph Bot
从Alph Bot中获得的关键经验
- Reuse connections — Alph Bot creates a connection once and polls it repeatedly, avoiding unnecessary creation overhead.
- Cursor pagination — Uses so each poll only returns new events, keeping responses fast and costs low.
since_event_id - Defensive data handling — Treats all fields as optional since the data shape varies by sport, game phase, and event type.
- Schedule-first workflow — Discovers game IDs via the schedule endpoint before creating targeted connections.
See the Alph Bot README for full setup instructions.
- 复用连接——Alph Bot只创建一次连接并重复轮询,避免了不必要的创建开销。
- 游标分页——使用,每次轮询仅返回新事件,保持响应速度快且成本低。
since_event_id - 防御性数据处理——将所有字段视为可选,因为数据结构会因体育项目、赛事阶段和事件类型而异。
- 先查日程的工作流——在创建定向连接前,通过日程端点发现赛事ID。
查看Alph Bot README获取完整的设置说明。
Versioning
版本控制
This API is versioned under . New versions will be introduced under a new prefix when breaking changes are required.
/api/v1/本API的版本为。当需要进行破坏性变更时,会在新的前缀下推出新版本。
/api/v1/