The problem: You need to research a legal issue across multiple jurisdictions. Manual research takes days.The solution: Use AI-powered web search to get answers with citations, or run deep research for comprehensive analysis.
Web data only. This searches publicly available web content. For comprehensive legal research (case law, statutes, regulations), use specialized platforms like Lexis, Westlaw, or OpenLaws.
Let your users get AI-generated answers to questions:
import Casedev from 'casedev';const client = new Casedev({ apiKey: process.env.CASEDEV_API_KEY });// Answer your user's questionconst result = await client.search.v1.answer({ query: userQuery, // e.g., "What is the statute of limitations for medical malpractice in California?" includeDomains: ['law.cornell.edu', 'findlaw.com', 'justia.com']});// Return answer with citations to your userconsole.log(result.answer);// "In California, the statute of limitations for medical malpractice// is 3 years from the date of injury or 1 year from discovery [1]..."console.log('\nSources:');for (const citation of result.citations) { console.log(`[${citation.id}] ${citation.title}`); console.log(` ${citation.url}`);}
For complex topics, offer your users comprehensive multi-step research:
// Start deep research for your userconst research = await client.search.v1.research({ instructions: userResearchTopic, // e.g., "Research non-compete agreement enforceability across US states" model: 'pro' // Most thorough});console.log(`Research started: ${research.researchId}`);// Wait for completionlet result = await client.search.v1.retrieveResearch(research.researchId);while (result.status !== 'completed') { console.log(`Status: ${result.status}...`); await new Promise(r => setTimeout(r, 10000)); result = await client.search.v1.retrieveResearch(research.researchId);}// Deliver the report to your userconsole.log(result.report);console.log(`\nSources analyzed: ${result.metadata.sourcesAnalyzed}`);