Skip to main content
This guide walks you through placing a real order on CoW Protocol using Python and the REST API directly. By the end, you will have submitted a signed intent on the Sepolia testnet and watched it get filled.
Prefer a higher-level approach? The cow-py SDK wraps all of this into a single swap_tokens() call with built-in signing, quoting, and order management. This guide is for developers who want to understand the raw API mechanics or who can’t use the SDK.

Prerequisites

Before starting, ensure you have:
  • Python 3.8+ installed
  • A wallet with test tokens on Sepolia (get Sepolia ETH from a faucet, then wrap it to WETH)
  • The wallet’s private key (never use a key that controls real funds for testing)
This guide uses the Sepolia testnet. Never hardcode private keys in production code. Use environment variables or a secrets manager.
Sepolia API base URL: Sepolia RPC: Settlement contract: GPv2VaultRelayer:

Installation

Install the required packages:

Walkthrough

Before placing orders in production, review the Pre-Flight Checklist to avoid the most common integration mistakes.

Troubleshooting

For a full list of API error codes, see the Order Book API Reference.

Next Steps

Now that you have placed your first order, explore more of CoW Protocol:
Last modified on March 17, 2026