Overview
Web Scraping Hub features a dual-mode search system that provides both quick search for instant results and deep search for comprehensive content discovery. The search architecture is built on React Query hooks with optimized caching and debouncing.Search Modes
- Quick Search
- Deep Search
Quick Search (Basic)
Fast API-based search that queries a JSON endpoint for immediate results.Best for:- Finding recently added content
- Quick title lookups
- Autocomplete suggestions
- Mobile browsing
Quick Search Implementation
Backend API Endpoint
The quick search uses a specialized JSON API that returns structured data:app.py:81-110
The quick search endpoint uses a nonce-based API that provides pre-indexed results for faster response times.
Frontend Search Hook
React Query hook with intelligent caching:search.ts:68-75
- Query key based on search term
- Disabled when query is empty
- 2-minute cache duration
- Automatic background refetching
Deep Search Implementation
Backend Endpoint
The deep search performs full HTML scraping for comprehensive results:app.py:143-156
Deep search uses the same
extraer_listado function as catalog browsing, ensuring consistent data structure.Deep Search Hook
search.ts:77-84
Data Normalization
Search Result Mapping
Both search modes normalize data to a consistent format:search.ts:36-63
Normalization Features
Normalization Features
- Multiple field fallbacks - Handles varying source data structures
- Genre parsing - Converts strings to arrays automatically
- Type classification - Maps Spanish/English type names to standard values
- Default values - Provides fallbacks for missing data
Search Performance
Debouncing Strategy
Search input is debounced to reduce API calls:Comparison: Quick vs Deep Search
| Feature | Quick Search | Deep Search |
|---|---|---|
| Speed | ~300ms | ~2s |
| Data Source | JSON API | HTML Scraping |
| Coverage | Recent items | Full catalog |
| Cloudflare Bypass | Not needed | Required |
| Results Format | Structured JSON | Parsed HTML |
| Cache Duration | 2 minutes | 2 minutes |
| Error Rate | Low | Medium |
URL Encoding
Deep search properly encodes query parameters:app.py:148
Error Handling
Backend Error Responses
Frontend Error States
The search hooks automatically handle error states through React Query:Search Features
Type Filtering
Results automatically categorized by movie/series/anime
Fuzzy Matching
Deep search finds partial matches and similar titles
Real-time Updates
Quick search provides live results as you type
Cache Optimization
Previous searches load instantly from cache
Integration with Catalog
Search results display in the same catalog grid:Advanced Search Patterns
Search by Title
Search by Year
Search by Genre
Search with Special Characters
Deep search handles special characters better than quick search due to full HTML parsing.
Cloudflare Bypass
Both search modes benefit from the Cloudflare bypass system:http_client.py:1-18
The
cloudscraper library automatically handles Cloudflare challenges, cookies, and JavaScript challenges.Search Result Quality
Data Completeness
Search results include:- ✅ Title and alternative titles
- ✅ Poster images with fallbacks
- ✅ Release year
- ✅ Genre classification
- ✅ Content type (movie/series/anime)
- ✅ Direct play URLs
- ✅ Language information
Missing Data Handling
search.ts:42-45
Best Practices
When to Use Quick Search
When to Use Quick Search
- Mobile users with limited bandwidth
- Recent content (last few months)
- Fast browsing sessions
- Autocomplete features
When to Use Deep Search
When to Use Deep Search
- Desktop users with good connection
- Older or obscure content
- Comprehensive research
- When quick search returns no results
Search Input Design
Search Input Design
- Implement 300-500ms debounce
- Show loading indicator during search
- Display “No results” message gracefully
- Provide search mode toggle if both available
API Reference
Quick Search Endpoint
busqueda(string): Search query
Deep Search Endpoint
query(string, required): Search query
Related Features
Catalog Browsing
Learn about section-based catalog navigation
Web Scraping
Understand the scraping technology behind search