screen size not supported

Search + filter API response JSON example

Last updated 2026-05-20

When to use this

Use this for a search-with-facets response — the matched items, an echo of the applied filters, and pagination cursors. Pair it with /products/search or /products/category/:name on this site.

Example JSON

Search response with applied filters echoed back.
{
  "query": "phone",
  "filters": {
    "category": "smartphones",
    "minPrice": 100,
    "maxPrice": 1500,
    "inStock": true
  },
  "facets": {
    "category": [
      {
        "value": "smartphones",
        "count": 12
      },
      {
        "value": "accessories",
        "count": 4
      }
    ],
    "brand": [
      {
        "value": "Apple",
        "count": 5
      },
      {
        "value": "Samsung",
        "count": 4
      }
    ]
  },
  "items": [
    {
      "id": 121,
      "title": "iPhone 9",
      "price": 549,
      "category": "smartphones",
      "brand": "Apple"
    },
    {
      "id": 122,
      "title": "iPhone X",
      "price": 899,
      "category": "smartphones",
      "brand": "Apple"
    }
  ],
  "total": 16,
  "skip": 0,
  "limit": 30
}

Request examples

const params = new URLSearchParams({ q: 'phone', limit: '10' });
const res = await fetch('https://jsonexamples.com/products/search?' + params);
const json = await res.json();

Try the live endpoint

Click below to call /products/search?q=phone from your browser.

// click the button to populate this block

Common variations

No results
{
  "query": "unobtanium",
  "filters": {},
  "items": [],
  "total": 0,
  "skip": 0,
  "limit": 30
}
With sort field
{
  "query": "phone",
  "sort": {
    "field": "price",
    "order": "desc"
  },
  "items": [
    {
      "id": 122,
      "title": "iPhone X",
      "price": 899
    }
  ],
  "total": 16,
  "skip": 0,
  "limit": 1
}

Convert this JSON

Generated starting points for TypeScript, JSON Schema, and Zod. Refine before shipping to production.

export interface SearchFilter {
  "query": string;
  "filters": {
    "category": string;
    "minPrice": number;
    "maxPrice": number;
    "inStock": boolean;
  };
  "facets": {
    "category": {
      "value": string;
      "count": number;
    }[];
    "brand": {
      "value": string;
      "count": number;
    }[];
  };
  "items": {
    "id": number;
    "title": string;
    "price": number;
    "category": string;
    "brand": string;
  }[];
  "total": number;
  "skip": number;
  "limit": number;
}