@@ -93,13 +93,11 @@ exp.sponsored_tv.create_campaign(...)
9393### 安装
9494
9595``` bash
96- # 从 GitHub 安装
97- pip install git+https://github.com/vanling1111/ amazon-ads-api-python-sdk.git
96+ # 从 PyPI 安装
97+ pip install amazon-ads-api
9898
99- # 或克隆后本地安装
100- git clone https://github.com/vanling1111/amazon-ads-api-python-sdk.git
101- cd amazon-ads-api-python-sdk
102- pip install -e .
99+ # 或从 GitHub 安装最新版
100+ pip install git+https://github.com/vanling1111/amazon-ads-api-python-sdk.git
103101```
104102
105103### 基础使用
@@ -112,23 +110,79 @@ client = AmazonAdsClient(
112110 client_id = " your_client_id" ,
113111 client_secret = " your_client_secret" ,
114112 refresh_token = " your_refresh_token" ,
113+ profile_id = " your_profile_id" , # 必需
115114 region = AdsRegion.NA , # NA, EU, FE
116115)
117116
118- # 设置 Profile ID
119- client.with_profile(" your_profile_id" )
120-
121117# 获取 SP Campaigns
122- campaigns = client.sp.campaigns.list_campaigns()
118+ campaigns = await client.sp.campaigns.list_campaigns()
123119print (campaigns)
124120
125121# 获取关键词
126- keywords = client.sp.keywords.list_keywords(campaign_id = " 123456" )
122+ keywords = await client.sp.keywords.list_keywords(campaign_id = " 123456" )
127123
128124# 更新竞价
129- client.sp.keywords.update_bid(keyword_id = " 789" , new_bid = 1.50 )
125+ await client.sp.keywords.update_bid(keyword_id = " 789" , new_bid = 1.50 )
130126```
131127
128+ ## 🏢 Multi-Account Support
129+
130+ This SDK is ** multi-account capable** and designed for concurrent use:
131+
132+ ✅ ** What the SDK provides:**
133+ - Multiple Amazon Ads accounts/profiles can run concurrently
134+ - Each ` AmazonAdsClient ` instance is completely isolated
135+ - Safe for async concurrent operations
136+ - Handles authentication, rate limiting, and retries per-client
137+
138+ ❌ ** What the SDK does NOT manage:**
139+ - SaaS tenant or user management
140+ - Persistent OAuth token storage
141+ - Account authorization flows
142+ - User-to-profile permission mapping
143+
144+ ** These are responsibilities of your application's Service layer.**
145+
146+ ### Example: Multiple Profiles Concurrently
147+
148+ ``` python
149+ import asyncio
150+ from amazon_ads_api import AmazonAdsClient, AdsRegion
151+
152+ # Create independent clients for different profiles
153+ client1 = AmazonAdsClient(
154+ client_id = ' ...' ,
155+ client_secret = ' ...' ,
156+ refresh_token = ' token_for_profile_1' ,
157+ profile_id = ' profile-123' ,
158+ region = AdsRegion.NA
159+ )
160+
161+ client2 = AmazonAdsClient(
162+ client_id = ' ...' ,
163+ client_secret = ' ...' ,
164+ refresh_token = ' token_for_profile_2' ,
165+ profile_id = ' profile-456' ,
166+ region = AdsRegion.NA
167+ )
168+
169+ # Concurrent operations are safe!
170+ campaigns1, campaigns2 = await asyncio.gather(
171+ client1.sp.campaigns.list_campaigns(),
172+ client2.sp.campaigns.list_campaigns()
173+ )
174+ ```
175+
176+ ### For SaaS Applications
177+
178+ If you're building a multi-tenant SaaS platform:
179+ 1 . Your ** database** stores user-to-profile mappings
180+ 2 . Your ** Service layer** validates user permissions
181+ 3 . Your ** Service layer** creates one ` AmazonAdsClient ` per profile
182+ 4 . Your ** API layer** enforces tenant boundaries
183+
184+ ** See [ examples/saas_integration.py] ( examples/saas_integration.py ) for a complete example.**
185+
132186### 高级用法 - v2.0 分级访问
133187
134188``` python
0 commit comments