Use the Python SDK to interact with Contracts APIs, which allow you interact with smart contracts on the blockchain using the Developer Services platform. This page provides short examples of how to install and use the Smart Contract Platform SDK. For complete examples, see the Sample Projects page. For more information see the Contracts documentation.Documentation Index
Fetch the complete documentation index at: https://developers.circle.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
To use the Python SDK, ensure you have:- Python installed.
- A Circle Developer Console account
- An API key created in the Console:
Keys → Create a key → API key → Standard Key - Your Entity Secret registered
Install the SDK
Use the following command to install the SDK with pip:Contracts client
To start using the SDK, you first need to configure a client and initialize it with your API key and entity secret.Import the client
The following example shows how to import the client and configure it to use your API key and entity secret:Import a smart contract
The following example shows how to import a smart contract using the client:Client configuration options
The client for the Contracts SDK accepts the following configuration parameters:| Option | Required? | Description |
|---|---|---|
api_key | Yes | The API key used to authenticate requests to the Circle API. |
entity_secret | Yes | Your configured entity secret. |
host | No | The base URL that overrides the default API URL of https://api.circle.com/v1/w3s. |
user_agent | No | Custom user agent request header. If provided, it’s added before the default user agent header. |