Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions integrations/langchain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ result = tool.invoke({

### ScrapeTool

Scrape a webpage and return it in the desired format:
Scrape a webpage and return it in the desired format. Supported formats: `markdown`, `html`, `screenshot`, `branding`, `links`, `images`, `summary`.

```python
from langchain_scrapegraph.tools import ScrapeTool
Expand Down Expand Up @@ -117,7 +117,7 @@ status_tool = CrawlStatusTool()
# Start a crawl job
result = start_tool.invoke({
"url": "https://example.com",
"depth": 2,
"max_depth": 2,
"max_pages": 5,
"format": "markdown",
})
Expand All @@ -141,12 +141,12 @@ from langchain_scrapegraph.tools import MonitorCreateTool, MonitorListTool
create_tool = MonitorCreateTool()
list_tool = MonitorListTool()

# Create a monitor
# Create a monitor (interval accepts cron expressions or shorthand like "1h", "30m")
result = create_tool.invoke({
"name": "Price Monitor",
"url": "https://example.com/products",
"prompt": "Extract current product prices",
"cron": "0 9 * * *", # Daily at 9 AM
"name": "Price Monitor",
"interval": "0 9 * * *", # Daily at 9 AM
"prompt": "Extract current product prices", # optional JSON extraction
})
print("Monitor created:", result)

Expand All @@ -157,13 +157,18 @@ print("All monitors:", monitors)

### HistoryTool

Retrieve request history:
Retrieve request history, optionally filtered by service with pagination:

```python
from langchain_scrapegraph.tools import HistoryTool

tool = HistoryTool()

# List the most recent requests
history = tool.invoke({})

# Filter to a specific service and page
history = tool.invoke({"service": "scrape", "page": 1, "limit": 20})
```

### GetCreditsTool
Expand Down