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.
Quick answer with citations
Let your users get AI-generated answers to questions:curl -X POST https://api.case.dev/search/v1/answer \
-H "Authorization: Bearer $CASEDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What is the statute of limitations for medical malpractice in California?",
"includeDomains": ["law.cornell.edu", "findlaw.com", "justia.com"]
}'
casedev search:v1 answer \
--query "What is the statute of limitations?"
import Casedev from 'casedev';
const client = new Casedev({ apiKey: process.env.CASEDEV_API_KEY });
// Answer your user's question
const 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 user
console.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}`);
}
import casedev
import os
client = casedev.Casedev(api_key=os.environ['CASEDEV_API_KEY'])
# Answer your user's question
result = client.search.v1.answer(
query=user_query, # e.g., "What is the statute of limitations..."
include_domains=['law.cornell.edu', 'findlaw.com', 'justia.com']
)
# Return answer with citations to your user
print(result.answer)
print('\nSources:')
for citation in result.citations:
print(f'[{citation.id}] {citation.title}')
print(f' {citation.url}')
result, _ := client.Search.V1.Answer(ctx, casedev.SearchV1AnswerParams{
Query: casedev.F("What is the statute of limitations?"),
})
fmt.Println(result.Answer)
for _, c := range result.Citations {
fmt.Printf("[%s] %s: %s\n", c.ID, c.Title, c.URL)
}
Deep research
For complex topics, offer your users comprehensive multi-step research:# Start research
RESEARCH=$(curl -s -X POST https://api.case.dev/search/v1/research \
-H "Authorization: Bearer $CASEDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"instructions": "Research non-compete agreement enforceability across US states",
"model": "pro"
}')
RESEARCH_ID=$(echo $RESEARCH | jq -r '.researchId')
# Get results
curl "https://api.case.dev/search/v1/research/$RESEARCH_ID" \
-H "Authorization: Bearer $CASEDEV_API_KEY"
casedev search:v1 retrieve-research --id $RESEARCH_ID
// Start deep research for your user
const 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 completion
let 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 user
console.log(result.report);
console.log(`\nSources analyzed: ${result.metadata.sourcesAnalyzed}`);
import time
# Start deep research for your user
research = client.search.v1.research(
instructions=user_research_topic, # e.g., "Research non-compete agreement enforceability..."
model='pro' # Most thorough
)
print(f'Research started: {research.research_id}')
# Wait for completion
result = client.search.v1.retrieve_research(research.research_id)
while result.status != 'completed':
print(f'Status: {result.status}...')
time.sleep(10)
result = client.search.v1.retrieve_research(research.research_id)
# Deliver the report to your user
print(result.report)
print(f'\nSources analyzed: {result.metadata.sources_analyzed}')
result, _ := client.Search.V1.GetResearch(ctx, researchID, casedev.SearchV1GetResearchParams{})
fmt.Println(result.Status)
fmt.Println(result.Report)
Web search
For simple searches, expose the search endpoint directly:curl -X POST https://api.case.dev/search/v1/search \
-H "Authorization: Bearer $CASEDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "SEC cryptocurrency enforcement actions 2024",
"numResults": 20,
"startPublishedDate": "2024-01-01",
"excludeDomains": ["reddit.com", "twitter.com"],
"includeText": true
}'
casedev search:v1 search \
--query "search query" \
--num-results 20 --include-text
// Search on behalf of your user
const results = await client.search.v1.search({
query: userSearchQuery,
numResults: 20,
startPublishedDate: '2024-01-01',
excludeDomains: ['reddit.com', 'twitter.com'],
includeText: true
});
// Return results to your user
for (const result of results.results) {
console.log(`${result.title}`);
console.log(`${result.url}`);
console.log(`Published: ${result.publishedDate}\n`);
}
# Search on behalf of your user
results = client.search.v1.search(
query=user_search_query,
num_results=20,
start_published_date='2024-01-01',
exclude_domains=['reddit.com', 'twitter.com'],
include_text=True
)
# Return results to your user
for result in results.results:
print(result.title)
print(result.url)
print(f'Published: {result.published_date}\n')
results, _ := client.Search.V1.Search(ctx, casedev.SearchV1SearchParams{
Query: casedev.F("search query"),
NumResults: casedev.F(int64(20)),
IncludeText: casedev.F(true),
})
for _, r := range results.Results {
fmt.Println(r.Title, r.URL)
}
Research models
Choose based on your users’ needs:| Model | Time | Depth | Use case |
|---|---|---|---|
fast | ~30 sec | Basic | Quick fact-checking |
normal | ~2 min | Good | Standard research |
pro | ~5 min | Best | Complex topics |
Tip: Use
includeDomains to restrict results to authoritative sources like government sites and legal databases.
