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",
// ...
// }]
}
main();curl -s "https://www.trustrails.app/api/search?query=laptop&brand=HP&min_price=400&max_price=600" \ -H "Authorization: Bearer $TRUSTRAILS_KEY"
Getting an API key: Contact us to get started with your API key for production use. For testing, 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 with filters (query, brand, category, min_price, max_price) | /api/search?query=laptop&brand=HP&min_price=400 |
| GET /api/product/[id] | Lookup a single product | /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