Expand description
The official Rust client for the 0xinsider Developer API: Polymarket analytics for sports and esports. Every tracked wallet is graded S to F from settled P&L; the API returns grades, large trades, sharp-money flow, positions, market snapshots, reports and search.
Every operation in the OpenAPI document
is a typed async method on Client, named after its operationId in
snake_case (listLeaderboard is Client::list_leaderboard). Required
parameters are arguments; optional ones go in a ...Params struct.
use oxinsider::{Client, ListLeaderboardParams};
let client = Client::from_env()?; // reads OXINSIDER_API_KEY
let board = client.list_leaderboard(&ListLeaderboardParams::default().limit(10)).await?;
for entry in &board.data {
println!("{} {:?}", entry.address, entry.grade);
}Build against the sandbox first: Client::sandbox
needs no key and answers every documented operation with example data.
- Absent is not zero. A field the API did not report is
None. Serve a truthful unavailable state; never read it as0. - Errors. A non-2xx answer is
Error::Api. Branch onApiError::codeandApiError::reason, never on the message. - Retries. Reads, and writes that carry an
Idempotency-Key, are retried on 408, 429, 502, 503 and 504, honoringRetry-Afterup to 60 seconds. - Pagination. Follow cursors to completion with
pagination::Pager. - Stream. Read
GET /api/v1/streamwithClient::open_stream. - Webhooks. Verify deliveries with
webhooks::verify_signature. - Where the credential goes. Over
https, orhttpto a loopback host only; anything else fails withError::InsecureTransportbefore a request is sent.
Re-exports§
pub use pagination::PaginationError;pub use pagination::PaginationErrorReason;pub use self;
Modules§
- models
- Typed models for every schema the OpenAPI document names, and for the request and response bodies it defines inline.
- pagination
- Following
next_cursorto the end of a list, safely. - provenance
- Which OpenAPI document this release was generated from.
- webhooks
- Verifying webhook deliveries.
Structs§
- Activate
Webhook Secret Params - Optional parameters for
Client::activate_webhook_secret(POST /api/v1/webhooks/{id}/rotate-secret/activate). - ApiError
- A non-2xx answer from the API, decoded from its JSON error envelope.
- Client
- A typed client for the 0xinsider Developer API.
- Client
Builder - Configures a
Client. - Create
McpJson RpcResponse Params - Optional parameters for
Client::create_mcp_json_rpc_response(POST /api/v1/mcp). - Create
Webhook Params - Optional parameters for
Client::create_webhook(POST /api/v1/webhooks). - Create
Webhook Verification Attempt Params - Optional parameters for
Client::create_webhook_verification_attempt(POST /api/v1/webhooks/{id}/verification-attempts). - Decode
Error - A 2xx body that did not match the type this release expects.
- Delete
Webhook Params - Optional parameters for
Client::delete_webhook(DELETE /api/v1/webhooks/{id}). - Download
- An open file download. Read it with
chunk,bytesorsave; dropping it closes the connection. - Download
Error - A download that could not be completed. The signed file URL is never part of it.
- Explore
Markets Params - Optional parameters for
Client::explore_markets(GET /api/v1/markets/explore). - GetCategory
Leaderboard Params - Optional parameters for
Client::get_category_leaderboard(GET /api/v1/leaderboard/categories/{slug}). - GetCombo
Params - Optional parameters for
Client::get_combo(GET /api/v1/combos/{condition_id}). - GetCombos
Summary Params - Optional parameters for
Client::get_combos_summary(GET /api/v1/combos/summary). - GetEdge
Hunter Params - Optional parameters for
Client::get_edge_hunter(GET /api/v1/edge-hunter). - GetEvent
Replay Since Params - Optional parameters for
Client::get_event_replay_since(GET /api/v1/events/feed/since). - GetGame
Holders Params - Optional parameters for
Client::get_game_holders(GET /api/v1/games/{event_slug}/holders). - GetGame
Params - Optional parameters for
Client::get_game(GET /api/v1/games/{event_slug}). - GetGame
Sharp Money Params - Optional parameters for
Client::get_game_sharp_money(GET /api/v1/games/{event_slug}/sharp-money). - GetHealth
Params - Optional parameters for
Client::get_health(GET /api/v1/health). - GetInsider
Radar Flag Params - Optional parameters for
Client::get_insider_radar_flag(GET /api/v1/insider-radar/{id}). - GetLarge
Trade Params - Optional parameters for
Client::get_large_trade(GET /api/v1/large-trades/{id}). - GetMarket
Candles Params - Optional parameters for
Client::get_market_candles(GET /api/v1/market/{condition_id}/candles). - GetMarket
Flow Params - Optional parameters for
Client::get_market_flow(GET /api/v1/market/{condition_id}/flow). - GetMarket
Holders Params - Optional parameters for
Client::get_market_holders(GET /api/v1/market/{condition_id}/holders). - GetMarket
Intel Params - Optional parameters for
Client::get_market_intel(GET /api/v1/market/{condition_id}/intel). - GetMarket
Snapshot Params - Optional parameters for
Client::get_market_snapshot(GET /api/v1/market/{condition_id}/snapshot). - GetMarket
TopHolders Params - Optional parameters for
Client::get_market_top_holders(GET /api/v1/market/{condition_id}/top-holders). - GetMarket
Wallets InOut Params - Optional parameters for
Client::get_market_wallets_in_out(GET /api/v1/market/{condition_id}/wallets-in-out). - GetPick
OfThe DayArchive Params - Optional parameters for
Client::get_pick_of_the_day_archive(GET /api/v1/pick-of-the-day/archive). - GetPick
OfThe DayLedger Entry Params - Optional parameters for
Client::get_pick_of_the_day_ledger_entry(GET /api/v1/pick-of-the-day/ledger/{pick_id}). - GetPick
OfThe DayLedger Params - Optional parameters for
Client::get_pick_of_the_day_ledger(GET /api/v1/pick-of-the-day/ledger). - GetPick
OfThe DayParams - Optional parameters for
Client::get_pick_of_the_day(GET /api/v1/pick-of-the-day). - GetPick
OfThe DayStats Params - Optional parameters for
Client::get_pick_of_the_day_stats(GET /api/v1/pick-of-the-day/stats). - GetPosition
Timeline ById Params - Optional parameters for
Client::get_position_timeline_by_id(GET /api/v1/traders/{trader}/position-timeline). - GetPosition
Timeline Params - Optional parameters for
Client::get_position_timeline(GET /api/v1/trader/{address}/position-timeline). - GetResolution
Report Params - Optional parameters for
Client::get_resolution_report(GET /api/v1/reports/resolutions). - GetSport
Leaderboard Params - Optional parameters for
Client::get_sport_leaderboard(GET /api/v1/leaderboard/sports/{sport}). - GetSuspicious
Trade Params - Optional parameters for
Client::get_suspicious_trade(GET /api/v1/suspicious-trades/{id}). - GetTrader
Category Records Params - Optional parameters for
Client::get_trader_category_records(GET /api/v1/trader/{address}/categories). - GetTrader
Context Params - Optional parameters for
Client::get_trader_context(GET /api/v1/trader/{address}/context). - GetTrader
Grade AtParams - Optional parameters for
Client::get_trader_grade_at(GET /api/v1/trader/{address}/grade-at). - GetTrader
Params - Optional parameters for
Client::get_trader(GET /api/v1/trader/{address}). - GetTrader
PnlParams - Optional parameters for
Client::get_trader_pnl(GET /api/v1/trader/{address}/pnl). - GetWeekly
Report Snapshot Params - Optional parameters for
Client::get_weekly_report_snapshot(GET /api/v1/reports/weekly). - GetWhale
Trade Params - Optional parameters for
Client::get_whale_trade(GET /api/v1/whale-trades/{id}). - Insecure
Transport Error - A credential would have been sent over plain HTTP to a host that is not
loopback. Nothing was sent.
originis the refused destination (scheme, host and port); the credential is never part of it. - List
Category Leaders Params - Optional parameters for
Client::list_category_leaders(GET /api/v1/leaderboard/categories). - List
Combo Fills Params - Optional parameters for
Client::list_combo_fills(GET /api/v1/combos/fills). - List
Game Markets Params - Optional parameters for
Client::list_game_markets(GET /api/v1/games/{event_slug}/markets). - List
Game Trades Params - Optional parameters for
Client::list_game_trades(GET /api/v1/games/{event_slug}/trades). - List
Games Params - Optional parameters for
Client::list_games(GET /api/v1/games). - List
Insider Radar Params - Optional parameters for
Client::list_insider_radar(GET /api/v1/insider-radar). - List
Large Positions Params - Optional parameters for
Client::list_large_positions(GET /api/v1/large-positions). - List
Large Trade Counterparty Executions Params - Optional parameters for
Client::list_large_trade_counterparty_executions(GET /api/v1/large-trades/{id}/counterparties/executions). - List
Large Trade Counterparty Makers Params - Optional parameters for
Client::list_large_trade_counterparty_makers(GET /api/v1/large-trades/{id}/counterparties/executions/{execution_id}/makers). - List
Large Trade History Params - Optional parameters for
Client::list_large_trade_history(GET /api/v1/large-trades/history). - List
Large Trades Params - Optional parameters for
Client::list_large_trades(GET /api/v1/large-trades). - List
Leaderboard Leagues Params - Optional parameters for
Client::list_leaderboard_leagues(GET /api/v1/leaderboard/leagues). - List
Leaderboard Params - Optional parameters for
Client::list_leaderboard(GET /api/v1/leaderboard). - List
Positions Params - Optional parameters for
Client::list_positions(GET /api/v1/positions). - List
Sharp Money Flows Params - Optional parameters for
Client::list_sharp_money_flows(GET /api/v1/markets/sharp-money-flows). - List
Smart Money Flows Params - Optional parameters for
Client::list_smart_money_flows(GET /api/v1/markets/smart-money-flows). - List
Suspicious Trades Params - Optional parameters for
Client::list_suspicious_trades(GET /api/v1/suspicious-trades). - List
Trending Wallets Params - Optional parameters for
Client::list_trending_wallets(GET /api/v1/leaderboard/trending). - List
Webhook Deliveries Params - Optional parameters for
Client::list_webhook_deliveries(GET /api/v1/webhooks/{id}/deliveries). - List
Whale Trade Counterparty Executions Params - Optional parameters for
Client::list_whale_trade_counterparty_executions(GET /api/v1/whale-trades/{id}/counterparties/executions). - List
Whale Trade Counterparty Makers Params - Optional parameters for
Client::list_whale_trade_counterparty_makers(GET /api/v1/whale-trades/{id}/counterparties/executions/{execution_id}/makers). - List
Whale Trade History Params - Optional parameters for
Client::list_whale_trade_history(GET /api/v1/whale-trades/history). - List
Whale Trades Params - Optional parameters for
Client::list_whale_trades(GET /api/v1/whale-trades). - Method
- The Request Method (VERB)
- Operation
- One operation in the OpenAPI document.
OPERATIONSlists them all. - Prepare
Webhook Secret Params - Optional parameters for
Client::prepare_webhook_secret(POST /api/v1/webhooks/{id}/rotate-secret/prepare). - Redeliver
Webhook Delivery Params - Optional parameters for
Client::redeliver_webhook_delivery(POST /api/v1/webhooks/{id}/deliveries/{delivery_id}/redeliver). - Retire
Webhook Secret Params - Optional parameters for
Client::retire_webhook_secret(POST /api/v1/webhooks/{id}/rotate-secret/retire). - Rotate
Webhook Secret Params - Optional parameters for
Client::rotate_webhook_secret(POST /api/v1/webhooks/{id}/rotate-secret). - Saved
Download - What
Download::savewrote. - Search
Content Params - Optional parameters for
Client::search_content(GET /api/v1/content/search). - Search
Markets Params - Optional parameters for
Client::search_markets(GET /api/v1/markets/search). - Stream
Frame - One delivered frame.
- Stream
Options - Options for
Client::open_stream. Start fromDefault::default(). - Stream
Protocol Error - The stream broke the SSE contract. The connection is closed.
- Stream
Reader - Reads the frames of one stream connection. Dropping it closes the connection.
- Submit
Trader Export Params - Optional parameters for
Client::submit_trader_export(POST /api/v1/trader/{address}/export). - Tagged
- A decoded body and the
ETagvalidator its response carried, from an operation’s..._with_etagmethod. - Update
Webhook Params - Optional parameters for
Client::update_webhook(PATCH /api/v1/webhooks/{id}).
Enums§
- ApiError
Kind - What kind of failure an
ApiErroris, from its HTTP status. - Download
Error Reason - Why a download failed.
- Error
- Every error this crate returns.
- Retry
Class - When a failed request may be sent again.
- Stream
Protocol Error Reason - What the stream did that the SSE contract does not allow.
Constants§
- API_
KEY_ ENV - The environment variable
Client::from_envreads the API key from. - DEFAULT_
MAX_ FRAME_ BYTES - Bytes held for one undelivered frame by default: 1 MiB. The largest real frame is a few KB.
- DEFAULT_
MAX_ READ_ BYTES Download::bytesrefuses a file larger than this unless told otherwise: 64 MiB.- OPERATIONS
- Every operation in the OpenAPI document, in document order.
- PRODUCTION_
BASE_ URL - The production API origin. Every operation path is relative to it.
- SANDBOX_
BASE_ URL - The sandbox: no credential, no production data, every documented operation
answered with its example. Add
sandbox_status=<code>to a query to get one of the errors the operation documents. - VERSION
- This crate’s version, sent in the
User-Agentheader.
Functions§
- is_
loopback_ host - True for
localhost, an address in127.0.0.0/8, or::1(bracketed or not). - is_
trusted_ destination - True when
urlmay receive a credential:httpsanywhere, orhttpto a loopback host.