polymarket-client is to hit the Gamma and CLOB APIs without any authentication. In this guide you will set up the dependency, list open markets, and pull a live order book — all before you need to touch private keys or feature flags. The whole thing takes fewer than five minutes on an existing Rust project.
Check your prerequisites
You need a recent stable Rust toolchain and the Tokio async runtime. Run the following to make sure you are on Rust 1.88 or newer:Tokio is added as a direct dependency in the next step — you do not need to install anything separately.
Add the dependency
Open your project’s Start with the default unless you already know you need order placement or realtime streams. You can add the
Cargo.toml and add polymarket-client along with Tokio. The default feature set is enough for all public, unauthenticated reads:secure feature at any point without changing your existing code.List open markets
Create a binary (or paste into
main.rs) and use PublicClient to page through open markets. The client is constructed with Environment::production(), which points at the live Polymarket endpoints:list_markets returns a lazy paginator. Calling .first_page() fires the first HTTP request and gives you a Page whose .items field holds the deserialized Market structs. You can call .next_page() in a loop to walk forward through all results.Fetch an order book
To read live bids and asks for a specific outcome token, use Replace
fetch_order_book with the token’s CLOB ID. You can find a token ID in the tokens array of any market returned by list_markets:"YOUR_YES_TOKEN_ID" with a real TokenId string from the previous step. The returned OrderBook contains typed Vec<Level> fields for bids and asks, with price and size already parsed into Rust decimals.Run the bundled example
The GitHub repository ships a You should see a short list of open market questions and their IDs printed to stdout. No environment variables or API keys are required for this example.
quickstart example that demonstrates both of the above in a single runnable file. Clone the repo and run it directly with Cargo:Next steps
Feature Flags
Learn which Cargo features to enable for your use case
Authentication
Configure SecureClient with your private key and API credentials
Trading
Place limit and market orders and manage open positions
Websockets
Subscribe to realtime market and user event streams

