|
57 | 57 | "required": true, |
58 | 58 | "schema": { |
59 | 59 | "type": "string" |
60 | | - } |
| 60 | + }, |
| 61 | + "example": "google" |
61 | 62 | }, |
62 | 63 | { |
63 | 64 | "name": "limit", |
|
134 | 135 | "schema": { |
135 | 136 | "type": "string" |
136 | 137 | }, |
137 | | - "example": "01KJXYJ7KCHXM0PDZHQD5293XE" |
| 138 | + "example": "01KPD6M5YVHWCNQCRK32BD02TP" |
138 | 139 | } |
139 | 140 | ], |
140 | 141 | "responses": { |
|
156 | 157 | "parameters": { |
157 | 158 | "system": { |
158 | 159 | "cpus": 0.125, |
159 | | - "memory_bytes": 512, |
| 160 | + "memory": 512, |
160 | 161 | "max_total_charge": 0, |
161 | 162 | "max_total_traffic": 0, |
162 | 163 | "execute_limit_time_seconds": 1800 |
|
210 | 211 | "Runs" |
211 | 212 | ], |
212 | 213 | "summary": "Start scraper run", |
213 | | - "description": "Start a new Worker run by `scraper_slug`. Verified runtime rule: `callback_url` is optional; include it when webhook orchestration is needed. `version` must come from `/api/scraper`. `input.parameters.custom` is dynamic and must be derived from `/api/scraper`. `input.parameters.system.memory` is measured in MB and corresponds to `memory_bytes` returned by `/api/scraper`.", |
| 214 | + "description": "Start a new Worker run by `scraper_slug`. Verified runtime rule: `callback_url` is optional; include it when webhook orchestration is needed. `version` must come from `/api/scraper`. `input.parameters.custom` is dynamic and must be derived from `/api/scraper`. `input.parameters.system.memory` is measured in MB and corresponds to `memory` returned by `/api/scraper`.", |
214 | 215 | "requestBody": { |
215 | 216 | "required": true, |
216 | 217 | "content": { |
|
222 | 223 | "async_run": { |
223 | 224 | "summary": "Async run with callback", |
224 | 225 | "value": { |
225 | | - "scraper_slug": "01KGYERXPXTABWXMGQKFCE43M2", |
226 | | - "version": "v1.0.1", |
| 226 | + "scraper_slug": "01KPD6M5YVHWCNQCRK32BD02TP", |
| 227 | + "version": "v1.0.5", |
227 | 228 | "is_async": true, |
228 | 229 | "input": { |
229 | 230 | "parameters": { |
|
236 | 237 | "proxy_region": "US" |
237 | 238 | }, |
238 | 239 | "custom": { |
239 | | - "startURLs": [ |
| 240 | + "url": [ |
240 | 241 | { |
241 | | - "url": "https://example.com" |
| 242 | + "lang": "en", |
| 243 | + "detail_url": "https://www.google.com/maps/place/Burger+King", |
| 244 | + "max_reviews_per_place": 20 |
242 | 245 | } |
243 | 246 | ] |
244 | 247 | } |
|
250 | 253 | "sync_run": { |
251 | 254 | "summary": "Sync run without callback", |
252 | 255 | "value": { |
253 | | - "scraper_slug": "01KGYERXPXTABWXMGQKFCE43M2", |
254 | | - "version": "v1.0.1", |
| 256 | + "scraper_slug": "01KPD6M5YVHWCNQCRK32BD02TP", |
| 257 | + "version": "v1.0.5", |
255 | 258 | "is_async": false, |
256 | 259 | "input": { |
257 | 260 | "parameters": { |
|
263 | 266 | "max_total_traffic": 0 |
264 | 267 | }, |
265 | 268 | "custom": { |
266 | | - "startURLs": [ |
| 269 | + "url": [ |
267 | 270 | { |
268 | | - "url": "https://example.com" |
| 271 | + "lang": "en", |
| 272 | + "detail_url": "https://www.google.com/maps/place/Burger+King", |
| 273 | + "max_reviews_per_place": 20 |
269 | 274 | } |
270 | 275 | ] |
271 | 276 | } |
272 | 277 | } |
273 | 278 | } |
274 | 279 | } |
275 | 280 | } |
| 281 | + }, |
| 282 | + "example": { |
| 283 | + "scraper_slug": "01KPD6M5YVHWCNQCRK32BD02TP", |
| 284 | + "version": "v1.0.5", |
| 285 | + "is_async": true, |
| 286 | + "input": { |
| 287 | + "parameters": { |
| 288 | + "system": { |
| 289 | + "cpus": 0.125, |
| 290 | + "memory": 512, |
| 291 | + "execute_limit_time_seconds": 1800, |
| 292 | + "max_total_charge": 0, |
| 293 | + "max_total_traffic": 0, |
| 294 | + "proxy_region": "US" |
| 295 | + }, |
| 296 | + "custom": { |
| 297 | + "url": [ |
| 298 | + { |
| 299 | + "lang": "en", |
| 300 | + "detail_url": "https://www.google.com/maps/place/Burger+King", |
| 301 | + "max_reviews_per_place": 20 |
| 302 | + } |
| 303 | + ] |
| 304 | + } |
| 305 | + } |
| 306 | + }, |
| 307 | + "callback_url": "https://your-callback.example.com/webhook" |
276 | 308 | } |
277 | 309 | } |
278 | 310 | } |
|
333 | 365 | "$ref": "#/components/schemas/TaskRunRequest" |
334 | 366 | }, |
335 | 367 | "example": { |
336 | | - "task_slug": "01KK0G4W9W4JYTWEA55KMG5QKP", |
| 368 | + "task_slug": "01KSFDXRNYGKT3NNE11EMR4W5X", |
337 | 369 | "callback_url": "https://your-callback.example.com/webhook" |
338 | 370 | } |
339 | 371 | } |
|
395 | 427 | "$ref": "#/components/schemas/RerunRequest" |
396 | 428 | }, |
397 | 429 | "example": { |
398 | | - "run_slug": "01KS2A1M515HG7PZX9STTB0KPH", |
| 430 | + "run_slug": "01KSFDS8XWTJME33C08XMCR6B9", |
399 | 431 | "callback_url": "https://your-callback.example.com/webhook" |
400 | 432 | } |
401 | 433 | } |
|
457 | 489 | "$ref": "#/components/schemas/RunSlugRequest" |
458 | 490 | }, |
459 | 491 | "example": { |
460 | | - "run_slug": "01KS2A1M515HG7PZX9STTB0KPH" |
| 492 | + "run_slug": "01KSFDS8XWTJME33C08XMCR6B9" |
461 | 493 | } |
462 | 494 | } |
463 | 495 | } |
|
531 | 563 | }, |
532 | 564 | "example": { |
533 | 565 | "page_index": 1, |
534 | | - "page_size": 20, |
| 566 | + "page_size": 10, |
535 | 567 | "status": 0, |
536 | | - "scraper_slug": "" |
| 568 | + "scraper_slug": "01KPD6M5YVHWCNQCRK32BD02TP" |
537 | 569 | } |
538 | 570 | } |
539 | 571 | } |
|
624 | 656 | }, |
625 | 657 | "example": { |
626 | 658 | "page_index": 1, |
627 | | - "page_size": 20, |
628 | | - "run_slug": "01KS2A1M515HG7PZX9STTB0KPH" |
| 659 | + "page_size": 10, |
| 660 | + "run_slug": "01KSFDS8XWTJME33C08XMCR6B9" |
629 | 661 | } |
630 | 662 | } |
631 | 663 | } |
|
715 | 747 | "$ref": "#/components/schemas/RunResultExportRequest" |
716 | 748 | }, |
717 | 749 | "example": { |
718 | | - "run_slug": "01KS2A1M515HG7PZX9STTB0KPH", |
719 | | - "filter_keys": [], |
| 750 | + "run_slug": "01KSFDS8XWTJME33C08XMCR6B9", |
| 751 | + "filter_keys": [ |
| 752 | + "title", |
| 753 | + "address" |
| 754 | + ], |
720 | 755 | "format": "csv" |
721 | 756 | } |
722 | 757 | } |
|
778 | 813 | "$ref": "#/components/schemas/RunSlugRequest" |
779 | 814 | }, |
780 | 815 | "example": { |
781 | | - "run_slug": "01KS2A1M515HG7PZX9STTB0KPH" |
| 816 | + "run_slug": "01KSFDS8XWTJME33C08XMCR6B9" |
782 | 817 | } |
783 | 818 | } |
784 | 819 | } |
|
854 | 889 | "$ref": "#/components/schemas/RunSlugRequest" |
855 | 890 | }, |
856 | 891 | "example": { |
857 | | - "run_slug": "01KJYA4S1QQ1PMDVVRP7XH72C51" |
| 892 | + "run_slug": "01KSFDS8XWTJME33C08XMCR6B9" |
858 | 893 | } |
859 | 894 | } |
860 | 895 | } |
|
990 | 1025 | "properties": { |
991 | 1026 | "run_slug": { |
992 | 1027 | "type": "string", |
993 | | - "description": "Unique run identifier returned by CoreClaw." |
| 1028 | + "description": "Unique run identifier returned by CoreClaw.", |
| 1029 | + "example": "01KSFDS8XWTJME33C08XMCR6B9" |
994 | 1030 | } |
995 | 1031 | }, |
996 | 1032 | "required": [ |
|
1007 | 1043 | }, |
1008 | 1044 | "memory": { |
1009 | 1045 | "type": "integer", |
1010 | | - "description": "Memory allocation in MB. This corresponds to `memory_bytes` returned by `/api/scraper`.", |
| 1046 | + "description": "Memory allocation in MB. Corresponds to the memory value returned by /api/scraper.", |
1011 | 1047 | "enum": [ |
1012 | 1048 | 512, |
1013 | 1049 | 1024, |
|
1032 | 1068 | "proxy_region": { |
1033 | 1069 | "type": "string", |
1034 | 1070 | "description": "ISO 3166-1 alpha-2 proxy region code. Defaults to `US` when omitted.", |
1035 | | - "pattern": "^[A-Z]{2}$" |
| 1071 | + "pattern": "^[A-Z]{2}$", |
| 1072 | + "default": "US" |
1036 | 1073 | } |
1037 | 1074 | }, |
1038 | 1075 | "required": [ |
|
1051 | 1088 | "type": "number", |
1052 | 1089 | "description": "Default CPU allocation." |
1053 | 1090 | }, |
1054 | | - "memory_bytes": { |
| 1091 | + "memory": { |
1055 | 1092 | "type": "integer", |
1056 | | - "description": "Default memory allocation in MB. Map this value to `input.parameters.system.memory` when calling `/api/v1/scraper/run`." |
| 1093 | + "description": "Default memory allocation in MB." |
1057 | 1094 | }, |
1058 | 1095 | "max_total_charge": { |
1059 | 1096 | "type": "number", |
|
1070 | 1107 | }, |
1071 | 1108 | "required": [ |
1072 | 1109 | "cpus", |
1073 | | - "memory_bytes", |
| 1110 | + "memory", |
1074 | 1111 | "max_total_charge", |
1075 | 1112 | "max_total_traffic", |
1076 | 1113 | "execute_limit_time_seconds" |
|
1111 | 1148 | "properties": { |
1112 | 1149 | "scraper_slug": { |
1113 | 1150 | "type": "string", |
1114 | | - "description": "Unique scraper identifier." |
| 1151 | + "description": "Unique scraper identifier.", |
| 1152 | + "example": "01KPD6M5YVHWCNQCRK32BD02TP" |
1115 | 1153 | }, |
1116 | 1154 | "version": { |
1117 | 1155 | "type": "string", |
1118 | | - "description": "Scraper version. Must be copied from `/api/scraper` -> `data.version`." |
| 1156 | + "description": "Scraper version. Must be copied from `/api/scraper` -> `data.version`.", |
| 1157 | + "example": "v1.0.5" |
1119 | 1158 | }, |
1120 | 1159 | "is_async": { |
1121 | 1160 | "type": "boolean", |
|
1412 | 1451 | "page_index": { |
1413 | 1452 | "type": "integer", |
1414 | 1453 | "description": "1-based page index.", |
1415 | | - "minimum": 1 |
| 1454 | + "minimum": 1, |
| 1455 | + "default": 1 |
1416 | 1456 | }, |
1417 | 1457 | "page_size": { |
1418 | 1458 | "type": "integer", |
1419 | 1459 | "description": "Page size.", |
1420 | | - "minimum": 1 |
| 1460 | + "minimum": 1, |
| 1461 | + "default": 10 |
1421 | 1462 | }, |
1422 | 1463 | "run_slug": { |
1423 | 1464 | "type": "string", |
1424 | 1465 | "description": "Run slug whose records should be listed." |
1425 | 1466 | } |
1426 | 1467 | }, |
1427 | 1468 | "required": [ |
1428 | | - "page_index", |
1429 | | - "page_size", |
1430 | 1469 | "run_slug" |
1431 | 1470 | ] |
1432 | 1471 | }, |
|
1450 | 1489 | "items": { |
1451 | 1490 | "$ref": "#/components/schemas/RunResultRecord" |
1452 | 1491 | } |
| 1492 | + }, |
| 1493 | + "page_index": { |
| 1494 | + "type": "integer", |
| 1495 | + "description": "Current page number (1-based)." |
| 1496 | + }, |
| 1497 | + "page_size": { |
| 1498 | + "type": "integer", |
| 1499 | + "description": "Number of records per page." |
1453 | 1500 | } |
1454 | 1501 | }, |
1455 | 1502 | "required": [ |
1456 | 1503 | "count", |
1457 | 1504 | "headers", |
1458 | | - "list" |
| 1505 | + "list", |
| 1506 | + "page_index", |
| 1507 | + "page_size" |
1459 | 1508 | ] |
1460 | 1509 | }, |
1461 | 1510 | "RunResultListResponse": { |
|
1503 | 1552 | }, |
1504 | 1553 | "required": [ |
1505 | 1554 | "run_slug", |
| 1555 | + "filter_keys", |
1506 | 1556 | "format" |
1507 | 1557 | ] |
1508 | 1558 | }, |
|
0 commit comments