PAPI
SDK

SDK Overview

Rust SDK for unified prediction market access

PAPI SDK

The PAPI SDK is a Rust library that provides unified access to prediction markets. It supports two modes of operation and normalizes data across exchanges into a consistent interface.

Repository: github.com/papi-team/papi-sdk-rs

Installation

Add to your Cargo.toml:

[dependencies]
papi-sdk = "0.1"
tokio = { version = "1", features = ["full"] }

Managed Mode

All requests go through the PAPI API at api.papi.market. The API handles:

  • Authentication — Your API key authenticates with PAPI
  • Caching — Market data is cached with short TTLs (5-60s) to reduce exchange API load
  • Rate Limiting — 60 requests per minute per API key
  • Unified Responses — Consistent JSON format across exchanges
  • Cross-Exchange Matching — Pair the same event on Polymarket and Kalshi with a single request

Core Types

The SDK normalizes exchange-specific data into shared types:

// Unified market representation
pub struct Market {
    pub id: String,
    pub exchange: Exchange,
    pub title: String,
    pub status: MarketStatus,
    pub outcomes: Vec<Outcome>,
    // ...
}

pub enum Exchange {
    Polymarket,
    Kalshi,
}

pub enum MarketStatus {
    Active,
    Closed,
    Settled,
}

Next Steps

On this page