TrustRails standardises messy retailer feeds into one predictable API. Use our SDK or REST API to search products by query, brand, category, and price range in real time.
Save weeks of integration time and focus on building your project, not babysitting product feeds.
import TrustRails from "@trustrails/sdk";
const trustrails = new TrustRails(process.env.TRUSTRAILS_KEY);
// The SDK sets Authorization: Bearer <TRUSTRAILS_KEY> automatically
async function main() {
// Use query to refine within brand + category (model lines, variants, series names)
const res = await trustrails.search({
brand: "Samsung",
category: "TVs",
query: "qled", // narrows to Samsung QLED TVs specifically
maxPrice: 1000,
});
console.log(res.products);
// [{
// id: "samsung-qled-001",
// title: "Samsung 55\" QLED 4K Smart TV",
// brand: "Samsung",
// price: 799,
// availability: "in_stock",
// category: "TVs",
// product_type: "product",
// ...
// }]
}
main();curl -s "https://trustrails.app/api/search?brand=Samsung&category=TVs&query=qled&max_price=1000" \ -H "Authorization: Bearer $TRUSTRAILS_KEY"
When to use query: Use it to refine within a brand and category - model lines, series names, variants, or model numbers. Examples: query="qled", query="neo", query="WH-1000XM5". Never put category names (query="tablet" → use category="Tablets"), brand names, product family names (MacBook, Galaxy, ThinkPad), or prices in query - use the brand, category, and min_price/max_price filters instead.
Free API Key: Use mcp-public-2026 for free access (50 requests/hour). For higher limits, contact us for a production key. Or try the Live Explorer (no auth required).
All errors return a consistent JSON structure:
{
"error": {
"type": "auth_error",
"message": "Missing or invalid token",
"request_id": "req_abc123"
}
}| Endpoint | Description | Example |
|---|---|---|
| GET /api/search | Search products. Returns summary data (title, price, availability). For full specs, use /api/product/[id] | /api/search?brand=HP&category=Laptops&lite=true |
| GET /api/product/[id] | Full details: complete specs, description, stock, delivery, and retailer source | /api/product/usb001 |
| GET /api/health | Check API status (no auth) | /api/health |
npm install @trustrails/sdk
The SDK handles everything for you:
Full type safety and autocomplete
Clear error messages with status codes
search(), product()
Currency helpers & data freshness