Vector Search
Powerful hybrid search combining semantic vector search with keyword matching for legal documents.
Overview
The HOLE Foundation Vector Search API provides:
- Hybrid Search: Combines vector embeddings with keyword matching
- Legal Document Focus: Optimized for statutes, case law, regulations
- Rich Metadata: Full context including citations, jurisdiction, dates
- Fast Results: Sub-second response times with relevance scoring
Search Endpoint
Basic Search
Python Example
Search Parameters
Query (Required)
The search query in natural language:
Limit (Optional)
Control number of results (default: 10, max: 100):
Include Context (Optional)
Get full document context with surrounding text:
Filters (Optional)
Filter by jurisdiction, document type, or custom metadata:
Available Filters:
jurisdiction: State/federal (e.g., “california”, “federal”, “texas”)document_type: Document category (“statute”, “regulation”, “case_law”)year: Publication yearcategory: Subject matter category- Custom metadata fields
Response Format
Search Result Structure
Understanding Scores
Search scores range from 0.0 to 1.0:
- 0.9 - 1.0: Highly relevant, exact matches
- 0.7 - 0.9: Very relevant, strong semantic match
- 0.5 - 0.7: Relevant, good contextual match
- < 0.5: Potentially relevant, review carefully
Get Document by ID
Retrieve full document content:
Advanced Use Cases
Multi-Jurisdiction Search
Search across multiple states:
Progressive Search
Start broad, then narrow with filters:
Citation Extraction
Extract legal citations from results:
Error Handling
Best Practices
1. Use Specific Queries
2. Set Appropriate Limits
3. Use Filters to Narrow Results
4. Handle Context Appropriately
Performance Tips
Caching
Cache frequently searched queries:
Pagination
For large result sets, use limit with offset pattern:
Rate Limits
- Free tier: 100 requests/day
- Standard tier: 1,000 requests/day
- Premium tier: 10,000 requests/day
See Rate Limits for details.
Related Endpoints
- Transparency API - Browse structured transparency data
- Chat API - AI-powered legal research assistant
- FOIA Dashboard - FOIA request management
Support
- 📧 Email: api@theholefoundation.org
- 💬 Discord: Join our community
- 🐛 Issues: GitHub Issues