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() {
const res = await trustrails.search({
query: "laptop",
brand: "HP",
minPrice: 400,
maxPrice: 600,
category: "Laptops"
});
console.log(res.products);
// [{
// id: "hp-laptop-001",
// title: "HP 15.6\" Laptop - Intel Core i5, 512GB SSD",
// brand: "HP",
// price: 549,
// availability: "in_stock",
// category: "Laptops",
// product_type: "product",
// ...
// }]
}
main();curl -s "https://trustrails.app/api/search?query=laptop&brand=HP&min_price=400&max_price=600" \ -H "Authorization: Bearer $TRUSTRAILS_KEY"
Free API Key: Use mcp-public-2026 for free access (100 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?query=laptop&lite=true&limit=10 |
| 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