Build AI agents that access live, trusted product data.

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.

Why use TrustRails?

Without TrustRails → 20 feeds, 10 CSV formats, constant breakage
With TrustRails → 1 API, 1 schema, live structured data

Save weeks of integration time and focus on building your project, not babysitting product feeds.

Quickstart

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();

Or use cURL:

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).

Error responses

All errors return a consistent JSON structure:

{
  "error": {
    "type": "auth_error",
    "message": "Missing or invalid token",
    "request_id": "req_abc123"
  }
}

API Endpoints

EndpointDescriptionExample
GET /api/searchSearch 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/healthCheck API status (no auth)/api/health

Install the SDK

npm install @trustrails/sdk

The SDK handles everything for you:

TypeScript types

Full type safety and autocomplete

Error handling

Clear error messages with status codes

Simple method names

search(), product()

Auto-includes provenance

Currency helpers & data freshness