Adding a search API to your React application used to mean choosing between Google's deprecated Custom Search free JSON formatter API or expensive SERP providers. In 2026, developers have far better options with unified APIs that handle search, scraping, and deep research in a single integration. This guide breaks down the best search API integration patterns for React apps and shows you which providers deliver the most value per dollar.
Key Takeaways
- SerpApi charges $25 for 1,000 searches (Starter), scaling to $3,750 for 1M. Expensive for React apps with live user searches.
- Brave Search API costs $5/1K searches with $5 free credits/month. Strong option but no scraping capabilities.
- Serper.dev offers pay-as-you-go at $0.50-$1.00/1K queries. 2,500 free on signup, credits valid 6 months.
- SearchHive provides SwiftSearch, ScrapeForge, and DeepDive in one API starting at $9/5K credits with 500 free to start.
- The best React integration pattern depends on whether you need live search, background crawling, or AI-powered research.
React Search API Comparison Table
| Feature | SerpApi | Brave Search API | Serper.dev | SearchHive SwiftSearch |
|---|---|---|---|---|
| Free tier | 250/mo | $5 credits/mo | 2,500 one-time | 500 credits |
| Starting price | $25/mo | $5/1K | $50 (50K credits) | $9/5K credits |
| Per-query cost (high vol) | $3.75/1K | $5/1K | $0.50/1K | ~$0.01/1K |
| Web scraping | No | No | No | Yes (ScrapeForge) |
| Deep research | No | No | No | Yes (DeepDive) |
| React SDK | Community | Community | Community | Official Python/REST |
| Rate limits | 200/hr (Starter) | 50/sec | 50/sec | Custom per plan |
| Response time | ~2 sec | ~1 sec | 1-2 sec | ~1.5 sec |
| JavaScript rendering | No | No | No | Yes |
Pattern 1: Client-Side Live Search with Debouncing
The simplest React search API integration is a live search bar that fires queries as the user types. The critical piece is debouncing to avoid hammering the API on every keystroke.
import React, { useState, useEffect, useCallback } from 'react';
function SearchBar() {
const [query, setQuery] = useState('');
const [results, setResults] = useState([]);
const [loading, setLoading] = useState(false);
const search = useCallback(async (q) => {
if (!q || q.length < 3) return;
setLoading(true);
try {
const res = await fetch(
'https://api.searchhive.dev/v1/swiftsearch',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.REACT_APP_SEARCHHIVE_KEY}`
},
body: JSON.stringify({ query: q, limit: 10 })
}
);
const data = await res.json();
setResults(data.results || []);
} catch (err) {
console.error('Search failed:', err);
} finally {
setLoading(false);
}
}, []);
useEffect(() => {
const timer = setTimeout(() => search(query), 400);
return () => clearTimeout(timer);
}, [query, search]);
return (
<div className="search-container">
<input
type="text"
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Search the web..."
/>
{loading && <span className="spinner">Searching...</span>}
<ul className="results">
{results.map((r, i) => (
<li key={i}>
<a href={r.url} target="_blank" rel="noopener">
{r.title}
</a>
<p>{r.snippet}</p>
</li>
))}
</ul>
</div>
);
}
export default SearchBar;
Why this works: The 400ms debounce means a user typing "best laptops 2026" only triggers 2-3 API calls instead of 20. With SearchHive's $9/5K plan, you can handle thousands of user searches per month without budget surprises.
Pattern 2: Server-Side Search with Next.js API Routes
For SEO and security, call the search API from a server-side API route instead of the browser. This hides your API key and enables caching.
// pages/api/search.js
import { searchHiveClient } from '../../lib/searchhive';
export default async function handler(req, res) {
const { q, page = 1 } = req.query;
if (!q) return res.status(400).json({ error: 'Query required' });
const cacheKey = `search:${q}:${page}`;
// Check Redis cache (example)
const cached = await redis.get(cacheKey);
if (cached) return res.json(JSON.parse(cached));
const results = await searchHiveClient.swiftsearch({
query: q,
limit: 10,
offset: (page - 1) * 10
});
await redis.setex(cacheKey, 3600, JSON.stringify(results));
return res.json(results);
}
# lib/searchhive.py - Python backend for SearchHive
import httpx
class SearchHiveClient:
BASE = "https://api.searchhive.dev/v1"
def __init__(self, api_key):
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
self.client = httpx.Client(base_url=self.BASE, headers=self.headers)
def swiftsearch(self, query, limit=10, offset=0):
resp = self.client.post("/swiftsearch", json={
"query": query,
"limit": limit,
"offset": offset
})
resp.raise_for_status()
return resp.json()
def scrapeforge(self, url, extract=None):
payload = {"url": url}
if extract:
payload["extract"] = extract
resp = self.client.post("/scrapeforge", json=payload)
resp.raise_for_status()
return resp.json()
def deepdive(self, query, max_depth=2):
resp = self.client.post("/deepdive", json={
"query": query,
"max_depth": max_depth
})
resp.raise_for_status()
return resp.json()
client = SearchHiveClient("your-api-key-here")
Pattern 3: Combined Search + Scraping for Rich Results
Most search APIs only return titles and snippets. SearchHive's ScrapeForge lets you grab the full content of search results for richer UI displays.
import asyncio
import httpx
async def search_and_scrape(query: str, api_key: str):
"""Search and scrape top 3 results for full content."""
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
async with httpx.AsyncClient() as client:
# Step 1: Search
search_resp = await client.post(
"https://api.searchhive.dev/v1/swiftsearch",
headers=headers,
json={"query": query, "limit": 3}
)
results = search_resp.json().get("results", [])
# Step 2: Scrape top results concurrently
scrape_tasks = []
for r in results:
scrape_tasks.append(
client.post(
"https://api.searchhive.dev/v1/scrapeforge",
headers=headers,
json={"url": r["url"], "format": "markdown"}
)
)
scrape_responses = await asyncio.gather(*scrape_tasks)
enriched = []
for r, scrape in zip(results, scrape_responses):
data = scrape.json()
enriched.append({
"title": r["title"],
"url": r["url"],
"snippet": r["snippet"],
"full_content": data.get("content", "")[:2000]
})
return enriched
This pattern is impossible with SerpApi or Brave Search API alone -- you would need a separate scraping provider like Firecrawl ($83/mo for 100K pages) or ScrapingBee ($49/mo for 250K). SearchHive bundles both for $9/mo.
Pattern 4: AI-Powered Research Summaries in React
For React apps that need summarized answers rather than raw search results, the DeepDive endpoint does multi-hop research automatically.
// pages/api/research.js
export default async function handler(req, res) {
const { topic } = req.body;
const response = await fetch(
'https://api.searchhive.dev/v1/deepdive',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.SEARCHHIVE_KEY}`
},
body: JSON.stringify({
query: topic,
max_depth: 2,
include_sources: true
})
}
);
const data = await response.json();
// Returns: { summary, sources, key_findings }
res.json(data);
}
Pricing Deep Dive
Let's compare what 100,000 monthly searches costs across providers:
| Provider | 100K searches/mo | What you get |
|---|---|---|
| SerpApi | $725 | Google SERP results only |
| Brave Search API | $500 | Brave index results only |
| Serper.dev | $375 (500K pack) | Google SERP results only |
| SearchHive | $49 (100K credits) | Search + scrape + deep dive |
SearchHive's Builder plan at $49/mo for 100K credits covers search, scraping, and research. SerpApi charges $725 for the same search volume with zero scraping capability.
Feature-by-Feature Breakdown
Search Quality
SerpApi and Serper.dev both parse Google results, which means excellent quality for web queries. Brave uses its own index (30B+ pages) -- solid but misses some long-tail content. SearchHive's SwiftSearch aggregates multiple sources for broader coverage.
Scraping Capabilities
Only SearchHive offers built-in web scraping. If you need to extract structured data from pages (pricing, product info, reviews), you would normally pay for a second API. Firecrawl charges $83/mo for 100K scraped pages. SearchHive includes scraping in the same credit system.
Rate Limits and Throughput
Brave Search API leads with 50 queries/sec. Serper.dev supports up to 100/sec on Scale plans. SearchHive's rate limits scale with your plan -- the $49 Builder plan handles production workloads comfortably.
Developer Experience
All four providers offer clean REST APIs. SearchHive's advantage is the unified endpoint structure -- one API key works across search, scraping, and research. No need to manage three separate integrations.
When to Use Each Provider
Choose SerpApi if: You specifically need Google SERP parsing with legal shield features and have a large budget. Their $150/mo Production plan only gives 15K searches.
Choose Brave Search API if: You want an independent index, care about privacy, and need straightforward pay-per-query pricing. The $5 free monthly credits are a nice touch.
Choose Serper.dev if: You need the cheapest per-query Google SERP data and can front $375 for bulk credits. Good for predictable workloads.
Choose SearchHive if: You need search AND scraping AND research in one API. The $9 Starter plan (5K credits) is the cheapest entry point, and the $49 Builder plan (100K credits) covers what would cost $500+ with competing combinations. /compare/serpapi /compare/firecrawl
Getting Started with SearchHive
- Sign up at searchhive.dev -- 500 free credits, no credit card needed
- Get your API key from the dashboard
- Make your first search:
import httpx
resp = httpx.post(
"https://api.searchhive.dev/v1/swiftsearch",
headers={"Authorization": "Bearer YOUR_KEY"},
json={"query": "react search API integration", "limit": 5}
)
print(resp.json())
- Build your React search component using any of the patterns above
SearchHive gives you SwiftSearch for live queries, ScrapeForge for content extraction, and DeepDive for AI-powered research -- all under one API key, at a fraction of what you would pay combining SerpApi + Firecrawl + a research tool. Check the docs and start building with the free tier today.