TrustRails standardises messy retailer feeds into one predictable API. Use our SDK or REST API to query products by brand, price, and stock 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: "Anker", maxPrice: 30 }); console.log(res.products); // [{ // id: "anker-65w", // title: "Anker 65W USB-C Charger", // price: 29.99, // availability: "in_stock", // ... // }] } main();
curl -s "https://www.trustrails.app/api/search?query=Anker&max_price=30" \ -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 | /api/search?query=Anker&max_price=30 |
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
Beyond USB-C chargers