You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace legacy v1 code snippets in all use-case pages with actual v2 method names and parameters so examples match the current SDK behavior.
Made-with: Cursor
user_prompt="Extract all news articles from the homepage, including title, content, author, publication date, category, and tags. Also extract featured images if available.",
59
+
response = client.extract(
60
+
url=source,
61
+
prompt="Extract all news articles from the homepage, including title, content, author, publication date, category, and tags. Also extract featured images if available.",
62
62
output_schema=NewsAggregationResult
63
63
)
64
64
aggregated_results.append(response)
@@ -110,50 +110,47 @@ class BlogMonitorResult(BaseModel):
user_prompt="Extract all blog posts from the last 7 days, including title, content, author, publication date, categories, and metadata. Calculate estimated reading time based on content length.",
prompt="Extract pricing information for all products including name, current price, original price if available, and availability status",
49
49
output_schema=PriceMonitorResult
50
50
)
51
51
@@ -86,8 +86,8 @@ class TrendAnalysisResult(BaseModel):
86
86
client = Client()
87
87
88
88
# Search and analyze market trends
89
-
response = client.searchscraper(
90
-
user_prompt="Analyze market trends and sentiment in the electric vehicle industry. Focus on pricing trends, consumer preferences, and technological advancements.",
89
+
response = client.search(
90
+
query="Analyze market trends and sentiment in the electric vehicle industry. Focus on pricing trends, consumer preferences, and technological advancements.",
Copy file name to clipboardExpand all lines: use-cases/research-analysis.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,8 +47,8 @@ class ResearchCollectionResult(BaseModel):
47
47
client = Client()
48
48
49
49
# Search and collect research papers
50
-
response = client.searchscraper(
51
-
user_prompt="Find recent research papers on machine learning applications in healthcare, focusing on papers published in the last year. Extract complete paper details including abstract, citations, and DOI.",
50
+
response = client.search(
51
+
query="Find recent research papers on machine learning applications in healthcare, focusing on papers published in the last year. Extract complete paper details including abstract, citations, and DOI.",
52
52
num_results=15, # Number of papers to collect
53
53
output_schema=ResearchCollectionResult
54
54
)
@@ -115,9 +115,9 @@ class IndustryAnalysis(BaseModel):
user_prompt="Extract comprehensive industry analysis including detailed market metrics, company profiles, trends, and regulatory factors. Focus on quantitative data where available.",
prompt="Extract comprehensive industry analysis including detailed market metrics, company profiles, trends, and regulatory factors. Focus on quantitative data where available.",
user_prompt="Extract detailed search results including positions, titles, descriptions, and all rich results. Also analyze ad presence and total result counts.",
66
+
response = client.extract(
67
+
url=f"https://www.google.com/search?q={keyword}",
68
+
prompt="Extract detailed search results including positions, titles, descriptions, and all rich results. Also analyze ad presence and total result counts.",
69
69
output_schema=SERPAnalysis
70
70
)
71
71
@@ -151,9 +151,9 @@ target_urls = [
151
151
152
152
for url in target_urls:
153
153
# Extract content metrics
154
-
response = client.smartscraper(
155
-
website_url=url,
156
-
user_prompt="Perform comprehensive content analysis including meta tags, headings structure, internal/external links, and structured data. Calculate content quality score based on best practices.",
154
+
response = client.extract(
155
+
url=url,
156
+
prompt="Perform comprehensive content analysis including meta tags, headings structure, internal/external links, and structured data. Calculate content quality score based on best practices.",
0 commit comments