API REFERENCE / V1

Sample Products API

Exercise catalog layouts and stock displays without a commerce database. Category filtering happens before pagination. A seed changes prices and stock predictably, while IDs, names and category assignment remain stable.

GEThttps://techidea.online/api/v1/sample/products

No client API key. Implemented endpoint; public launch and production security remain unverified.

Use it in an application

Request category=home and seed=demo to build a category listing with reproducible USD prices. Use pagination.total for the filtered record count rather than assuming every category page has 200 products.

200 synthetic products per seed; five categories with 40 records each. Not real offers or inventory.

Query parameters

ParameterRequiredRules
seedNoOptional 1–64 ASCII letters, digits, underscores or hyphens. Default techidea-v1. Identical seeds return identical data.
categoryNoOptional exact category: electronics, stationery, home, outdoors or apparel. Omit for all products.
pageNoOptional integer 1–10000; default 1. Beyond the last page returns an empty array.
limitNoOptional integer 1–100; default 20.

Unknown and repeated parameters are rejected. Send no request body. Optional empty playground fields are omitted from the URL. The server validates that country/state codes exist, not just their format.

Example request

Configured production base: https://techidea.online. These snippets show the contract, not a claim that a public deployment is live. Check the HTTP status before using data.

const response = await fetch("https://techidea.online/api/v1/sample/products?seed=demo&category=home&page=1&limit=2");
const body = await response.json();
if (!response.ok) {
  throw new Error(body.error?.message || "HTTP " + response.status);
}
console.log(body);

Example JSON response

Recorded from the M4A handler for /api/v1/sample/products?seed=demo&category=home&page=1&limit=2 · HTTP 200. This is a static documentation example, not a live playground result.

{
  "success": true,
  "data": [
    {
      "id": 3,
      "name": "Demo Storage Basket 003",
      "category": "home",
      "price": 17.81,
      "currency": "USD",
      "stockQuantity": 123,
      "status": "available"
    },
    {
      "id": 8,
      "name": "Demo Storage Basket 008",
      "category": "home",
      "price": 160.75,
      "currency": "USD",
      "stockQuantity": 2,
      "status": "available"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 2,
    "total": 40,
    "totalPages": 20
  },
  "meta": {
    "fictional": true,
    "seed": "demo",
    "notice": "Synthetic demonstration data only. Not real people, customers, products or offers."
  }
}

Record fields

FieldMeaning
idInteger demo ID, 1–200.
nameFictional product name beginning with Demo.
categoryOne of the five documented categories.
priceNumeric demonstration price in USD, 5–200.
currencyUSD; no currency conversion.
stockQuantityInteger synthetic stock quantity, 0–250.
statusout_of_stock when stock is zero; otherwise available.

The envelope includes success, data and meta. Location metadata identifies the dataset and coverage; sample metadata marks the data fictional and records the seed.

Pagination

Defaults are page=1 and limit=20, with limit capped at 100 and page at 10000. The pagination object contains page, limit, total and totalPages. Filtering happens before pagination; an out-of-range page returns an empty array with the real total. No cursors are implemented.

Errors and troubleshooting

Categories are exact lowercase values; an unknown category returns 400 rather than an empty catalog. Prices and stock are fictional. No search, price-range, sorting or stock filters are implemented.

Example error for /api/v1/sample/products?category=invalid · HTTP 400:

{
  "success": false,
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "Unsupported category. Use electronics, stationery, home, outdoors or apparel."
  }
}
HTTPMeaning
200Successful JSON response; an empty data array is valid.
400Missing, unknown, repeated or invalid query parameter; unsupported preflight header.
403Origin is not permitted by the configured CORS policy.
405Unsupported method; use GET, HEAD or OPTIONS.
413Request bodies are not accepted.
414Request URL exceeds 2,048 characters.
429Rate limited. Wait for Retry-After; do not retry immediately.
500Safe internal error or configured response-size limit exceeded.
503Service disabled, configuration incomplete, or gateway unavailable.

Access and rate limits

The prepared Nginx defaults are 60 requests/minute/IP with burst 20, a global 50 requests/second budget and 10 concurrent connections/IP. These are configurable deployment defaults, not verified live limits. A 429 includes Retry-After. The playground waits before permitting another request; your integration should also honor that header.

The browser sends no gateway token. Production defaults to disabled until the private Nginx gateway is configured; a direct request can return 503. CORS defaults to anonymous wildcard reads but can be restricted to exact origins. Do not send credentials. Responses are no-store with a default 256 KiB server cap. Read access and launch requirements →

Data source, license and limitations

These records are generated by TechIdea's deterministic M4A sample-data functions. They are fictional, not purchased records or customer data. No third-party product/user dataset license applies. example.com addresses are examples; products are not offers. Use the rows for demonstrations and tests, not business decisions.

LIVE · SAME ORIGIN

API playground

GET

Requests go to this site, not the production example URL. A 503 means the gateway or service is unavailable. No API key or proxy secret is sent by this UI.

Optional 1–64 ASCII letters, digits, underscores or hyphens. Default techidea-v1. Identical seeds return identical data.
Optional exact category: electronics, stationery, home, outdoors or apparel. Omit for all products.
Optional integer 1–10000; default 1. Beyond the last page returns an empty array.
Optional integer 1–100; default 20.

GET /api/v1/sample/products?seed=techidea-v1&page=1&limit=20

No request has been sent.

Related APIs