Skip to content

Commit d8f2553

Browse files
VinciGit00claude
andcommitted
fix: rename monitor cron param to interval per v2 API
Aligns with scrapegraph-py PR #82 which renamed the `cron` field to `interval` in MonitorCreateRequest to match the v2 API contract. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 80c577a commit d8f2553

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ The server enables sophisticated queries across various scraping scenarios:
441441
- For structured fields per page, run **`smartscraper`** on individual URLs (or **`monitor_create`** on a schedule)
442442

443443
### Monitors and account
444-
- **Monitor**: "Run this extract prompt on https://example.com every day at 9am" (`monitor_create` with cron)
444+
- **Monitor**: "Run this extract prompt on https://example.com every day at 9am" (`monitor_create` with interval)
445445
- **Credits / history**: `credits`, `sgai_history`
446446
- **Agentic Scraper**: "Execute a complex workflow: login, navigate to reports, download data, and extract summary statistics"
447447

src/scrapegraph_mcp/server.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,15 @@ def monitor_create(
318318
name: str,
319319
url: str,
320320
prompt: str,
321-
cron: str,
321+
interval: str,
322322
output_schema: Optional[Dict[str, Any]] = None,
323323
fetch_config_dict: Optional[Dict[str, Any]] = None,
324324
) -> Dict[str, Any]:
325325
body: Dict[str, Any] = {
326326
"name": name,
327327
"url": url,
328328
"prompt": prompt,
329-
"cron": cron,
329+
"interval": interval,
330330
}
331331
if output_schema is not None:
332332
body["output_schema"] = output_schema
@@ -1546,7 +1546,7 @@ def monitor_create(
15461546
name: str,
15471547
url: str,
15481548
prompt: str,
1549-
cron: str,
1549+
interval: str,
15501550
ctx: Context,
15511551
output_schema: Optional[
15521552
Annotated[
@@ -1574,7 +1574,7 @@ def monitor_create(
15741574
name: Monitor name.
15751575
url: URL to monitor.
15761576
prompt: Prompt for AI extraction.
1577-
cron: 5-field cron expression.
1577+
interval: 5-field cron expression for scheduling.
15781578
output_schema: JSON schema for structured output.
15791579
mode: Fetch/proxy mode — auto, fast, js, direct+stealth, js+stealth.
15801580
headers: Custom HTTP headers.
@@ -1606,7 +1606,7 @@ def monitor_create(
16061606
cookies=cookies, country=country, scrolls=scrolls, mock=mock,
16071607
)
16081608
return client.monitor_create(
1609-
name=name, url=url, prompt=prompt, cron=cron,
1609+
name=name, url=url, prompt=prompt, interval=interval,
16101610
output_schema=normalized_schema, fetch_config_dict=fc,
16111611
)
16121612
except Exception as e:

0 commit comments

Comments
 (0)