360 Secure SkillHub
360 安全技能中心

browse-products

封装商品语义搜索 API:用自然语言查询结合向量嵌入检索商品,支持最低/最高价格筛选、分页、仅标题或仅描述搜索、按相关性/价格/日期排序,以及单次最多 50 条的批量查询;返回商品标题、描述、价格、折扣、图片、链接、相关性评分与分页元数据。

gzipped
gzipped
热度 36.60
最近更新 2026-05-11 17:45:50
分类:搜索依赖:第三方 API应用场景:购物 / 推荐

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add browse-products
Metadata
name
products-browse-skill
description
Semantic product search API using vector embeddings. Search products by natural language queries with price filtering, pagination, and relevance scoring. Use when the user wants to search products, browse a product catalog, or find items by description.

Products Browse Skill

This skill provides access to a semantic product search API that uses vector embeddings to find products by meaning rather than keyword matching.

Prerequisites

  • Valid query text (natural language, max 500 characters)

Quick Start

1. Search for Products

GET https://pbs-search-api-fp45p.ondigitalocean.app/api/v1/products/search?query=<your-query>

Example:

GET https://pbs-search-api-fp45p.ondigitalocean.app/api/v1/products/search?query=wireless+bluetooth+headphones

2. Filter by Price Range

GET https://pbs-search-api-fp45p.ondigitalocean.app/api/v1/products/search?query=running+shoes&minPrice=50&maxPrice=200

3. Browse Full API Documentation

See complete API reference for all endpoints, parameters, and response formats.

Search Parameters

Parameter Required Default Description
query Yes — Natural language search text (max 500 chars)
minPrice No — Minimum price filter
maxPrice No — Maximum price filter
page No 1 Page number (1-based)
pageSize No 20 Results per page (max 100)
titleOnly No false Search only product titles
descriptionOnly No false Search only product descriptions
sortBy No relevance Sort: relevance, price, date
sortOrder No desc Order: asc, desc

Bulk Search

For multiple queries in one request:

POST https://pbs-search-api-fp45p.ondigitalocean.app/api/v1/products/search/bulk

Send a JSON array of search requests (max 50 per request).

Best Practices

  1. Write natural queries — Semantic search works best with descriptive phrases (e.g. "comfortable running shoes for marathon" vs "shoes marathon")
  2. Use price filters — Combine minPrice and maxPrice to narrow results
  3. Use titleOnly for precision — When searching for specific product names
  4. Check relevanceScore — Scores closer to 1.0 indicate stronger semantic matches
  5. Paginate wisely — Smaller pages (10-20) are faster than large ones

Displaying Products to the User

When presenting search results to the user, follow these guidelines to ensure a rich and useful experience:

  1. Show product images — Use the imageUrls field from each product to display as many product photos as possible. Visual content is essential for helping users evaluate products.
  2. Always display the price — Show the price field clearly. If priceWithoutDiscount and discountPercent are available, highlight the discount (e.g., strikethrough the original price, show the discount percentage).
  3. Include product links — Every product should have a clickable link (product title or a "View in Store" button) pointing to the product url so the user can navigate directly to the store.
  4. Use a card-based layout — Present each product as a card containing: image(s), title, price, and a link to the store. This creates a clean, scannable browsing experience.
  5. Keep descriptions concise — Show a short product description or key attributes, but prioritize images and pricing for quick scanning.

Response Format

Each search returns:

  • metadata — pagination info, search time, cache status, embedding model
  • results[] — matching products with id, title, description, price, url, relevanceScore, and attributes

For complete response schema, see API reference.

cURL Examples

Single search

curl -G "https://pbs-search-api-fp45p.ondigitalocean.app/api/v1/products/search" \
  -d "query=wireless+bluetooth+headphones" \
  -d "minPrice=50" \
  -d "maxPrice=200" \
  -d "page=1" \
  -d "pageSize=10"

Bulk search

curl -X POST "https://pbs-search-api-fp45p.ondigitalocean.app/api/v1/products/search/bulk" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "query": { "text": "running shoes" },
      "pagination": { "page": 1, "pageSize": 5 }
    },
    {
      "query": { "text": "tennis racket" },
      "pagination": { "page": 1, "pageSize": 5 }
    }
  ]'