Price comparison tools are one of the most profitable side projects -- affiliate commissions on every click. But building one from scratch means solving multiple data problems.
Here is how to build a basic price comparison tool using free APIs, with no backend costs.
Architecture
User enters product URL -> Scrape metadata -> Enrich with market data -> Display comparison
We will use 4 free APIs to build this:
- Web Metadata Extractor API -- Pull product titles, images, descriptions from URLs
- Currency Exchange Rate API -- Convert prices across currencies
- AI Text API -- Summarize product descriptions
- SEO Analyzer API -- Score product page quality (for ranking which merchants to feature)
All available on RapidAPI with free tiers.
Step 1: Extract Product Data from URLs
When a user pastes a product URL, extract the metadata:
async function extractProductInfo(url) {
const response = await fetch(
`https://web-meta-extractor-api.p.rapidapi.com/extract?url=${encodeURIComponent(url)}`,
{
headers: {
'X-RapidAPI-Key': API_KEY,
'X-RapidAPI-Host': 'web-metadata-extractor-api.p.rapidapi.com',
},
}
);
const data = await response.json();
return {
title: data.metadata.ogTitle || data.metadata.title,
image: data.metadata.ogImage,
description: data.metadata.ogDescription || data.metadata.description,
price: extractPriceFromMeta(data.metadata),
};
}
Step 2: Normalize Prices Across Currencies
Products from different countries? Normalize to one currency:
async function convertPrice(amount, fromCurrency, toCurrency) {
const response = await fetch(
`https://currency-exchange-rate-api.p.rapidapi.com/convert?from=${fromCurrency}&to=${toCurrency}&amount=${amount}`,
{
headers: {
'X-RapidAPI-Key': API_KEY,
'X-RapidAPI-Host': 'currency-exchange-rate-api.p.rapidapi.com',
},
}
);
const data = await response.json();
return data.result;
}
// Usage
const priceUSD = await convertPrice(2980, 'JPY', 'USD'); // 2,980 JPY -> $19.87
Step 3: Summarize Product Descriptions
Long product descriptions? Summarize them for quick comparison:
async function summarizeDescription(text) {
const response = await fetch(
'https://ai-text-api.p.rapidapi.com/summarize',
{
method: 'POST',
headers: {
'X-RapidAPI-Key': API_KEY,
'X-RapidAPI-Host': 'ai-text-api.p.rapidapi.com',
'Content-Type': 'application/json',
},
body: JSON.stringify({ text, max_length: 100 }),
}
);
const data = await response.json();
return data.summary;
}
Step 4: Score Merchant Page Quality
Use SEO analysis to rank which merchant pages are most trustworthy:
async function scoreMerchant(url) {
const response = await fetch(
`https://seo-analyzer-api.p.rapidapi.com/analyze?url=${encodeURIComponent(url)}`,
{
headers: {
'X-RapidAPI-Key': API_KEY,
'X-RapidAPI-Host': 'seo-analyzer-api.p.rapidapi.com',
},
}
);
const data = await response.json();
return {
seoScore: data.score,
hasSSL: data.checks.ssl,
mobileOptimized: data.checks.viewport,
};
}
Putting It Together
async function compareProducts(urls) {
const products = await Promise.all(
urls.map(async (url) => {
const [info, seo] = await Promise.all([
extractProductInfo(url),
scoreMerchant(url),
]);
const normalizedPrice = info.price
? await convertPrice(info.price.amount, info.price.currency, 'USD')
: null;
const summary = info.description
? await summarizeDescription(info.description)
: 'No description available';
return {
url,
title: info.title,
image: info.image,
price: normalizedPrice,
summary,
trustScore: seo.seoScore,
};
})
);
return products.sort((a, b) => (a.price || Infinity) - (b.price || Infinity));
}
Cost Analysis
With free tiers (500 req/month each):
| API | Calls per comparison | Monthly comparisons possible |
|---|---|---|
| Metadata Extractor | 1 per URL | 500 |
| Currency Exchange | 1 per URL | 500 |
| AI Text | 1 per URL | 500 |
| SEO Analyzer | 1 per URL | 500 |
Comparing 3 products = 12 API calls. Free tier supports about 40 comparisons/month.
For production, the Basic plans ($4.99-5.99/mo each) give you 5,000-50,000 requests -- enough for thousands of daily comparisons at under $25/month total infrastructure cost.
Monetization
- Affiliate links: Replace product URLs with affiliate tracking links
- Sponsored listings: Charge merchants for featured placement
- Premium features: Price alerts, historical price charts (using cached API data)
Next Steps
- Add a database (Supabase free tier) to cache product data
- Set up a cron job to refresh prices daily
- Build email alerts for price drops
- Add more data sources (product review APIs, stock availability)
The full source code pattern works with any product category -- electronics, books, software, SaaS tools.
What would you build with these APIs? Price comparison is just one pattern -- the same metadata + currency + AI stack works for content aggregators, research tools, and marketplace builders.
Top comments (0)