decodo-sdk 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. decodo_sdk-2.2.0/LICENSE +21 -0
  2. decodo_sdk-2.2.0/PKG-INFO +459 -0
  3. decodo_sdk-2.2.0/README.md +409 -0
  4. decodo_sdk-2.2.0/pyproject.toml +67 -0
  5. decodo_sdk-2.2.0/setup.cfg +4 -0
  6. decodo_sdk-2.2.0/src/decodo/__init__.py +292 -0
  7. decodo_sdk-2.2.0/src/decodo/api/__init__.py +3 -0
  8. decodo_sdk-2.2.0/src/decodo/api/web_scraping_api.py +74 -0
  9. decodo_sdk-2.2.0/src/decodo/client.py +58 -0
  10. decodo_sdk-2.2.0/src/decodo/codegen/__init__.py +0 -0
  11. decodo_sdk-2.2.0/src/decodo/codegen/codegen.py +71 -0
  12. decodo_sdk-2.2.0/src/decodo/codegen/web_scraping_api/__init__.py +0 -0
  13. decodo_sdk-2.2.0/src/decodo/codegen/web_scraping_api/generate_parameters.py +124 -0
  14. decodo_sdk-2.2.0/src/decodo/codegen/web_scraping_api/generate_targets.py +223 -0
  15. decodo_sdk-2.2.0/src/decodo/codegen/web_scraping_api/shared.py +65 -0
  16. decodo_sdk-2.2.0/src/decodo/codegen/web_scraping_api/types.py +26 -0
  17. decodo_sdk-2.2.0/src/decodo/errors.py +36 -0
  18. decodo_sdk-2.2.0/src/decodo/generated/__init__.py +0 -0
  19. decodo_sdk-2.2.0/src/decodo/generated/decodo.ir.json +2775 -0
  20. decodo_sdk-2.2.0/src/decodo/generated/parameters.py +93 -0
  21. decodo_sdk-2.2.0/src/decodo/generated/targets.py +1585 -0
  22. decodo_sdk-2.2.0/src/decodo/http.py +111 -0
  23. decodo_sdk-2.2.0/src/decodo/py.typed +0 -0
  24. decodo_sdk-2.2.0/src/decodo/schema/__init__.py +25 -0
  25. decodo_sdk-2.2.0/src/decodo/schema/build_target_meta.py +23 -0
  26. decodo_sdk-2.2.0/src/decodo/schema/bundled_schema.py +97 -0
  27. decodo_sdk-2.2.0/src/decodo/schema/constants.py +5 -0
  28. decodo_sdk-2.2.0/src/decodo/schema/expand_path.py +12 -0
  29. decodo_sdk-2.2.0/src/decodo/schema/remote_schema.py +136 -0
  30. decodo_sdk-2.2.0/src/decodo/schema/resolve_latest_ir.py +69 -0
  31. decodo_sdk-2.2.0/src/decodo/schema/types.py +65 -0
  32. decodo_sdk-2.2.0/src/decodo/targets.py +63 -0
  33. decodo_sdk-2.2.0/src/decodo/types/__init__.py +27 -0
  34. decodo_sdk-2.2.0/src/decodo/types/requests.py +7 -0
  35. decodo_sdk-2.2.0/src/decodo/types/responses.py +71 -0
  36. decodo_sdk-2.2.0/src/decodo_sdk.egg-info/PKG-INFO +459 -0
  37. decodo_sdk-2.2.0/src/decodo_sdk.egg-info/SOURCES.txt +40 -0
  38. decodo_sdk-2.2.0/src/decodo_sdk.egg-info/dependency_links.txt +1 -0
  39. decodo_sdk-2.2.0/src/decodo_sdk.egg-info/requires.txt +10 -0
  40. decodo_sdk-2.2.0/src/decodo_sdk.egg-info/top_level.txt +1 -0
  41. decodo_sdk-2.2.0/tests/test_http.py +57 -0
  42. decodo_sdk-2.2.0/tests/test_web_scraping_api.py +74 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Decodo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,459 @@
1
+ Metadata-Version: 2.4
2
+ Name: decodo-sdk
3
+ Version: 2.2.0
4
+ Summary: Official Python SDK for the Decodo APIs
5
+ Author: Decodo
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Decodo
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/Decodo/sdk-python
29
+ Project-URL: Documentation, https://help.decodo.com/docs/introduction
30
+ Project-URL: Repository, https://github.com/Decodo/sdk-python
31
+ Keywords: decodo,scraping,web-scraping,api
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3.12
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: Topic :: Internet :: WWW/HTTP
37
+ Requires-Python: >=3.12
38
+ Description-Content-Type: text/markdown
39
+ License-File: LICENSE
40
+ Requires-Dist: httpx>=0.27.0
41
+ Requires-Dist: pydantic>=2.0
42
+ Requires-Dist: jsonschema>=4.0
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
45
+ Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
46
+ Requires-Dist: ruff>=0.4.0; extra == "dev"
47
+ Requires-Dist: mypy>=1.10.0; extra == "dev"
48
+ Requires-Dist: types-jsonschema>=4.0; extra == "dev"
49
+ Dynamic: license-file
50
+
51
+ # Decodo Python SDK
52
+
53
+ ![Python](https://img.shields.io/badge/python-%3E%3D3.12-green)
54
+ ![License](https://img.shields.io/badge/license-MIT-blue)
55
+
56
+ [![](https://dcbadge.limes.pink/api/server/https://discord.gg/Ja8dqKgvbZ)](https://discord.gg/Ja8dqKgvbZ)
57
+
58
+ <p align="center">
59
+ <a href="https://dashboard.decodo.com/integrations?utm_source=github&utm_medium=social&utm_campaign=mcp_server"> <img src="https://github.com/user-attachments/assets/a1e52a9e-3da1-4081-b3c6-053aafb8f196"/></a>
60
+
61
+ The official Python SDK for the Decodo Web Scraping API.
62
+
63
+ Build scraping workflows for search engines, eCommerce platforms, social media, AI tools, and more using the Decodo Web Scraping API.
64
+
65
+ - Fully typed targets and parameters with IDE autocomplete
66
+ - Sync, async, and batch scraping methods
67
+ - Built on `httpx`, Python 3.12+
68
+ - Typed error hierarchy for safer integrations
69
+ - Built for Python and modern tooling
70
+
71
+ # What is Decodo Python SDK?
72
+
73
+ Decodo Python SDK is the official Python SDK for the Decodo Web Scraping API. It provides a typed interface for interacting with Decodo targets like Google, Amazon, TikTok, Reddit, YouTube, ChatGPT, Perplexity, and more.
74
+
75
+ Instead of manually constructing HTTP requests and validating payloads, you can work with fully typed methods and target-specific parameters directly in your editor.
76
+
77
+ # Why use the SDK?
78
+
79
+ - **Typing and autocomplete**. Target parameters are fully typed for better DX and fewer mistakes.
80
+ - **Unified scraping interface**. Work with search engines, eCommerce platforms, social media, and AI tools through one SDK.
81
+ - **Async and batch workflows**. Create scraping tasks, poll statuses, and process batches at scale.
82
+ - **Typed errors**. Handle authentication, validation, timeout, and rate-limit failures safely.
83
+ - **Minimal setup**. Single dependency on `httpx`, no additional HTTP client required.
84
+
85
+ ## Requirements
86
+
87
+ - Python 3.12+
88
+
89
+ ## Installation
90
+
91
+ ```bash
92
+ pip install decodo-sdk
93
+ ```
94
+
95
+ ## Quick start
96
+
97
+ Create a new project:
98
+
99
+ ```sh
100
+ mkdir scrape-with-decodo
101
+ cd scrape-with-decodo
102
+
103
+ pip install decodo-sdk
104
+
105
+ touch main.py
106
+ ```
107
+
108
+ Get your Web Scraping API token from the [Decodo dashboard](https://dashboard.decodo.com/welcome). The token is the base64-encoded `user:password` value from the Basic Auth credentials shown in the dashboard.
109
+
110
+ ```python
111
+ # main.py
112
+ from decodo import DecodoClient, DecodoConfig, WebScrapingApiConfig
113
+
114
+ client = DecodoClient(
115
+ DecodoConfig(
116
+ web_scraping_api=WebScrapingApiConfig(token="<basic_auth_token>"),
117
+ )
118
+ )
119
+
120
+ result = client.web_scraping_api.scrape({
121
+ "target": "google_search",
122
+ "query": "coffee shops",
123
+ "geo": "United States",
124
+ "parse": True,
125
+ })
126
+ print(result)
127
+ ```
128
+
129
+ Run the script:
130
+
131
+ ```
132
+ python main.py
133
+ ```
134
+
135
+ ### With typed parameters (recommended)
136
+
137
+ Typed parameter classes are included in the package — no extra steps needed after `pip install decodo-sdk`:
138
+
139
+ ```python
140
+ from decodo import DecodoClient, DecodoConfig, GoogleSearchParams, Target, WebScrapingApiConfig
141
+
142
+ client = DecodoClient(
143
+ DecodoConfig(
144
+ web_scraping_api=WebScrapingApiConfig(token="<basic_auth_token>"),
145
+ )
146
+ )
147
+
148
+ result = client.web_scraping_api.scrape(
149
+ GoogleSearchParams(
150
+ target=Target.GoogleSearch,
151
+ query="coffee shops",
152
+ geo="United States",
153
+ parse=True,
154
+ )
155
+ )
156
+ print(result)
157
+ ```
158
+
159
+ ### Updating types to a newer schema
160
+
161
+ The types bundled in the package reflect the schema at release time. To update them to the latest schema without waiting for a new release, run the type generator:
162
+
163
+ ```bash
164
+ python -m decodo.codegen.codegen --out-dir ./decodo_generated
165
+ ```
166
+
167
+ Then import from that directory instead:
168
+
169
+ ```python
170
+ from decodo_generated.targets import GoogleSearchParams
171
+ ```
172
+
173
+ > The directory name passed to `--out-dir` becomes the import namespace. `./decodo_generated` → `from decodo_generated.targets import ...`. You can use any name, but keep it consistent across your project.
174
+
175
+ <details>
176
+ <summary>Example response</summary>
177
+
178
+ ```json
179
+ {
180
+ "results": [
181
+ {
182
+ "content": {
183
+ "results": {
184
+ "last_visible_page": 10,
185
+ "page": 1,
186
+ "parse_status_code": 12000,
187
+ "results": {
188
+ "local_pack": [
189
+ {
190
+ "items": [
191
+ {
192
+ "address": "Rochester, NY",
193
+ "paid": false,
194
+ "pos": 1,
195
+ "rating": 4.9,
196
+ "rating_count": 1700,
197
+ "subtitle": "Coffee shop",
198
+ "title": "Albunn Coffee House"
199
+ },
200
+ {
201
+ "address": "Rochester, NY",
202
+ "paid": false,
203
+ "pos": 2,
204
+ "rating": 4.8,
205
+ "rating_count": 937,
206
+ "subtitle": "Coffee shop",
207
+ "title": "Layali Coffee House"
208
+ },
209
+ {
210
+ "address": "Ocean Township, NJ",
211
+ "paid": false,
212
+ "pos": 3,
213
+ "rating": 4.9,
214
+ "rating_count": 124,
215
+ "subtitle": "Coffee shop",
216
+ "title": "Ocean Brew Co."
217
+ }
218
+ ],
219
+ "pos_overall": 1
220
+ }
221
+ ],
222
+ "organic": [
223
+ {
224
+ "desc": "For an alternate, local view, Eater has an interesting list of what it considers Philadelphia's 21 Essential Coffee Shops.",
225
+ "pos": 1,
226
+ "pos_overall": 2,
227
+ "title": "Philadelphia",
228
+ "url": "https://www.brian-coffee-spot.com/the-coffee-spot-guide-to/usa-canada/philadelphia/"
229
+ }
230
+ ],
231
+ "search_information": {
232
+ "query": "coffee shops",
233
+ "total_results_count": 403000000
234
+ }
235
+ },
236
+ "url": "https://www.google.com/search?q=coffee+shops&hl=en&gl=us"
237
+ },
238
+ "errors": [],
239
+ "status_code": 12000,
240
+ "task_id": "7463508496927950850"
241
+ },
242
+ "status_code": 200,
243
+ "url": "https://www.google.com/search?q=coffee+shops&hl=en&gl=us",
244
+ "task_id": "7463508496927950850",
245
+ "created_at": "2026-05-22 08:38:10",
246
+ "updated_at": "2026-05-22 08:38:13"
247
+ }
248
+ ]
249
+ }
250
+ ```
251
+
252
+ </details>
253
+
254
+ ## Configuration
255
+
256
+ ```python
257
+ from decodo import DecodoClient, DecodoConfig, WebScrapingApiConfig
258
+
259
+ client = DecodoClient(
260
+ DecodoConfig(
261
+ web_scraping_api=WebScrapingApiConfig(token="<basic_auth_token>"),
262
+ timeout_ms=120_000, # optional, request timeout in ms (default: 180000)
263
+ )
264
+ )
265
+ ```
266
+
267
+ | Parameter | Description |
268
+ | --- | --- |
269
+ | `token` | Web Scraping API basic auth token - the base64-encoded `user:password` string from the Decodo dashboard |
270
+ | `timeout_ms` | Request timeout in milliseconds (default: 180000) |
271
+
272
+ ## Web Scraping API
273
+
274
+ Access the API via `client.web_scraping_api`.
275
+
276
+ The snippets below assume you have already constructed a client. See [Configuration](#configuration) for how to build one.
277
+
278
+ ### Sync scrape
279
+
280
+ Waits for the scraping result before returning:
281
+
282
+ ```python
283
+ result = client.web_scraping_api.scrape({
284
+ "target": "amazon_product",
285
+ "query": "B09H74FXNW",
286
+ "parse": True,
287
+ })
288
+ ```
289
+
290
+ ### Async scrape
291
+
292
+ Creates a scraping task and returns immediately. Poll separately for task status and results:
293
+
294
+ ```python
295
+ task = client.web_scraping_api.scrape_async({
296
+ "target": "google_search",
297
+ "query": "laptop reviews",
298
+ "parse": True,
299
+ })
300
+
301
+ meta = client.web_scraping_api.get_status(task["id"])
302
+ print(meta["status"]) # 'pending' | 'done' | 'faulted'
303
+
304
+ results = client.web_scraping_api.get_results(task["id"])
305
+ ```
306
+
307
+ ### Batch scrape
308
+
309
+ Send multiple queries or URLs in a single request:
310
+
311
+ ```python
312
+ batch = client.web_scraping_api.scrape_batch({
313
+ "target": "google_search",
314
+ "query": ["coffee", "tea", "juice"],
315
+ "parse": True,
316
+ })
317
+
318
+ coffee_task_id = batch["queries"][0]["id"]
319
+
320
+ client.web_scraping_api.get_results(coffee_task_id)
321
+ ```
322
+
323
+ ## Supported targets
324
+
325
+ Each target accepts one primary input parameter (`url`, `query`, `product_id`, or `prompt`) together with optional configuration. The examples below show the minimum payload to call `client.web_scraping_api.scrape(...)`.
326
+
327
+ ### Search engines
328
+
329
+ | Target | Description | Example |
330
+ | --- | --- | --- |
331
+ | `Target.GoogleSearch` | Google Search results for a query | `{"target": Target.GoogleSearch, "query": "coffee shops"}` |
332
+ | `Target.GoogleMaps` | Google Maps search results | `{"target": Target.GoogleMaps, "query": "coffee shops brooklyn"}` |
333
+ | `Target.GoogleShoppingSearch` | Google Shopping search results | `{"target": Target.GoogleShoppingSearch, "query": "laptop"}` |
334
+ | `Target.GoogleShoppingProduct` | Google Shopping product page | `{"target": Target.GoogleShoppingProduct, "query": "B09H74FXNW"}` |
335
+ | `Target.GoogleSuggest` | Google Autocomplete suggestions | `{"target": Target.GoogleSuggest, "query": "coffee"}` |
336
+ | `Target.GoogleLens` | Google Lens reverse image search | `{"target": Target.GoogleLens, "query": "https://example.com/cat.jpg"}` |
337
+ | `Target.GoogleTravelHotels` | Google Travel hotel listings | `{"target": Target.GoogleTravelHotels, "query": "hotels in paris"}` |
338
+ | `Target.GoogleTrendsExplore` | Google Trends explore data | `{"target": Target.GoogleTrendsExplore, "query": "coffee"}` |
339
+ | `Target.GoogleAds` | Google Ads results for a query | `{"target": Target.GoogleAds, "query": "laptop"}` |
340
+ | `Target.BingSearch` | Bing Search results | `{"target": Target.BingSearch, "query": "electric vehicles"}` |
341
+ | `Target.Bing` | Raw Bing URL scraping | `{"target": Target.Bing, "url": "https://bing.com/search?q=laptop"}` |
342
+
343
+ ### eCommerce
344
+
345
+ | Target | Description | Example |
346
+ | --- | --- | --- |
347
+ | `Target.AmazonProduct` | Amazon product detail page by ASIN | `{"target": Target.AmazonProduct, "query": "B09H74FXNW"}` |
348
+ | `Target.AmazonSearch` | Amazon search results | `{"target": Target.AmazonSearch, "query": "laptop"}` |
349
+ | `Target.AmazonPricing` | Amazon pricing and offers | `{"target": Target.AmazonPricing, "query": "B09H74FXNW"}` |
350
+ | `Target.AmazonSellers` | Amazon seller listings | `{"target": Target.AmazonSellers, "query": "B09H74FXNW"}` |
351
+ | `Target.AmazonBestsellers` | Amazon bestsellers by category | `{"target": Target.AmazonBestsellers, "query": "electronics"}` |
352
+ | `Target.WalmartProduct` | Walmart product page by product ID | `{"target": Target.WalmartProduct, "product_id": "15296401808"}` |
353
+ | `Target.WalmartSearch` | Walmart search results | `{"target": Target.WalmartSearch, "query": "laptop"}` |
354
+ | `Target.Walmart` | Raw Walmart URL scraping | `{"target": Target.Walmart, "url": "https://walmart.com/ip/15296401808"}` |
355
+ | `Target.TargetProduct` | Target.com product page by product ID | `{"target": Target.TargetProduct, "product_id": "92186007"}` |
356
+ | `Target.TargetSearch` | Target.com search results | `{"target": Target.TargetSearch, "query": "laptop"}` |
357
+ | `Target.Target` | Raw Target.com URL scraping | `{"target": Target.Target, "url": "https://target.com/p/-/A-92186007"}` |
358
+ | `Target.LowesSearch` | Lowe's search results | `{"target": Target.LowesSearch, "query": "drill"}` |
359
+ | `Target.Ecommerce` | Generic eCommerce page with parser | `{"target": Target.Ecommerce, "url": "https://example.com/product/123"}` |
360
+
361
+ ### Social media
362
+
363
+ | Target | Description | Example |
364
+ | --- | --- | --- |
365
+ | `Target.RedditPost` | Reddit post by URL | `{"target": Target.RedditPost, "url": "https://reddit.com/r/nba/..."}` |
366
+ | `Target.RedditSubreddit` | Reddit subreddit by URL | `{"target": Target.RedditSubreddit, "url": "https://reddit.com/r/nba/"}` |
367
+ | `Target.RedditUser` | Reddit user profile by URL | `{"target": Target.RedditUser, "url": "https://reddit.com/user/example/"}` |
368
+ | `Target.YoutubeVideo` | YouTube video by ID | `{"target": Target.YoutubeVideo, "query": "dFu9aKJoqGg"}` |
369
+ | `Target.YoutubeSearch` | YouTube search results | `{"target": Target.YoutubeSearch, "query": "ambient music"}` |
370
+ | `Target.YoutubeSearchMax` | YouTube search results (extended) | `{"target": Target.YoutubeSearchMax, "query": "ambient music"}` |
371
+ | `Target.YoutubeMetadata` | YouTube video metadata by ID | `{"target": Target.YoutubeMetadata, "query": "dFu9aKJoqGg"}` |
372
+ | `Target.YoutubeTranscript` | YouTube video transcript by ID | `{"target": Target.YoutubeTranscript, "query": "dFu9aKJoqGg"}` |
373
+ | `Target.YoutubeSubtitles` | YouTube video subtitles by ID | `{"target": Target.YoutubeSubtitles, "query": "dFu9aKJoqGg"}` |
374
+ | `Target.YoutubeChannel` | YouTube channel by URL | `{"target": Target.YoutubeChannel, "url": "https://youtube.com/@mkbhd"}` |
375
+ | `Target.TiktokPost` | TikTok post by URL | `{"target": Target.TiktokPost, "url": "https://www.tiktok.com/@nba/video/..."}` |
376
+ | `Target.TiktokShopSearch` | TikTok Shop search results | `{"target": Target.TiktokShopSearch, "query": "wireless earbuds"}` |
377
+ | `Target.TiktokShopProduct` | TikTok Shop product page | `{"target": Target.TiktokShopProduct, "url": "https://www.tiktok.com/view/product/..."}` |
378
+ | `Target.Tiktok` | Raw TikTok URL scraping | `{"target": Target.Tiktok, "url": "https://www.tiktok.com/@nba"}` |
379
+ | `Target.InstagramGraphqlProfile` | Instagram profile via GraphQL | `{"target": Target.InstagramGraphqlProfile, "query": "nba"}` |
380
+
381
+ ### AI tools
382
+
383
+ | Target | Description | Example |
384
+ | --- | --- | --- |
385
+ | `Target.Chatgpt` | ChatGPT response for a prompt | `{"target": Target.Chatgpt, "prompt": "What are the top three dog breeds?"}` |
386
+ | `Target.Perplexity` | Perplexity response for a prompt | `{"target": Target.Perplexity, "prompt": "What causes seasonal allergies?"}` |
387
+ | `Target.Gemini` | Gemini response for a prompt | `{"target": Target.Gemini, "prompt": "What are the top three dog breeds?"}` |
388
+ | `Target.GoogleAiMode` | Google AI Mode response | `{"target": Target.GoogleAiMode, "query": "What are the top three dog breeds?"}` |
389
+
390
+ ### Other
391
+
392
+ | Target | Description | Example |
393
+ | --- | --- | --- |
394
+ | `Target.Bbb` | Better Business Bureau listing by URL | `{"target": Target.Bbb, "url": "https://bbb.org/us/ny/new-york/..."}` |
395
+ | `Target.Autotrader` | Autotrader listing by URL | `{"target": Target.Autotrader, "url": "https://autotrader.com/cars-for-sale/..."}` |
396
+ | `Target.Mobile` | Mobile.de listing by URL | `{"target": Target.Mobile, "url": "https://mobile.de/auto/..."}` |
397
+ | `Target.Airbnb` | Airbnb listing by URL | `{"target": Target.Airbnb, "url": "https://airbnb.com/rooms/12345"}` |
398
+ | `Target.AppleAppStore` | Apple App Store app by URL | `{"target": Target.AppleAppStore, "url": "https://apps.apple.com/app/id12345"}` |
399
+
400
+ ### Universal scraping
401
+
402
+ | Target | Description | Example |
403
+ | --- | --- | --- |
404
+ | `Target.Universal` | Any URL via the universal scraper | `{"target": Target.Universal, "url": "https://example.com"}` |
405
+ | `Target.Google` | Raw Google URL scraping | `{"target": Target.Google, "url": "https://google.com/search?q=laptop"}` |
406
+ | `Target.Amazon` | Raw Amazon URL scraping | `{"target": Target.Amazon, "url": "https://amazon.com/dp/B09H74FXNW"}` |
407
+
408
+ > `Target.UniversalEcommerce` isn't listed above because it doesn't accept a primary input parameter like `url`, `query`, `product_id`, or `prompt`. It only accepts optional configuration fields such as `callback_url`.
409
+
410
+ For the full target list and parameter details, see the API documentation:
411
+
412
+ - [Target list](https://help.decodo.com/docs/web-scraping-api-targets)
413
+ - [Parameters](https://help.decodo.com/docs/web-scraping-api-parameters)
414
+
415
+ ## Error handling
416
+
417
+ The SDK raises typed errors that map to API error codes:
418
+
419
+ ```python
420
+ from decodo import (
421
+ AuthenticationError,
422
+ RateLimitError,
423
+ ValidationError,
424
+ TimeoutError,
425
+ )
426
+
427
+ try:
428
+ client.web_scraping_api.scrape({
429
+ "target": "google_search",
430
+ "query": "test",
431
+ "parse": True,
432
+ })
433
+ except AuthenticationError:
434
+ pass # 401/403 - bad credentials
435
+ except RateLimitError:
436
+ pass # 429 - too many requests
437
+ except ValidationError as err:
438
+ print(err.errors) # 422 - invalid parameters
439
+ except TimeoutError:
440
+ pass # request timed out
441
+ ```
442
+
443
+ ## Related repositories
444
+
445
+ - [Web Scraping API](https://github.com/Decodo/Web-Scraping-API)
446
+ - [Decodo MCP Server](https://github.com/Decodo/mcp-server)
447
+ - [Decodo OpenClaw Skill](https://github.com/Decodo/decodo-openclaw-skill)
448
+
449
+ ## Get started
450
+
451
+ Build scraping workflows with the Decodo Web Scraping API:
452
+
453
+ - [Start free plan](https://dashboard.decodo.com/)
454
+ - [Documentation](https://help.decodo.com/docs/introduction)
455
+ - [Discord](https://discord.gg/Ja8dqKgvbZ)
456
+
457
+ ## License
458
+
459
+ Released under the [MIT License](https://github.com/Decodo/Decodo/blob/master/LICENSE).