商品 API
カテゴリ、価格、評価、在庫を持つ EC の商品。メモリ上の固定データで、書き込みはアプリの再起動まで残ります。
無料:これらのエンドポイントはアカウント不要です。
- GET
https://api.testingapis.com/api/ProductsList products with filtering, sorting, search and pagination. - POST
https://api.testingapis.com/api/ProductsCreate a product. - GET
https://api.testingapis.com/api/Products/{id}Get a product by ID. - PUT
https://api.testingapis.com/api/Products/{id}Update a product. - DELETE
https://api.testingapis.com/api/Products/{id}Delete a product. - GET
https://api.testingapis.com/api/Products/categoriesList product categories without duplicates. - GET
https://api.testingapis.com/api/Products/category/{name}List the products in a category.
リクエストの例
List products with filtering, sorting, search and pagination. 完全なリファレンスと Send ボタン(英語).
cURL
curl -X GET "https://api.testingapis.com/api/Products?limit=2"レスポンス · 200 OK
[
{
"id": 1,
"title": "Wireless Noise-Cancelling Headphones",
"price": 249.99,
"description": "Over-ear headphones with 30hr battery life and active noise cancellation.",
"category": "electronics",
"image": "https://picsum.photos/seed/prod1/400/400",
"rating": {"rate": 4.3, "count": 127},
"inStock": true,
"createdAt": "2025-06-12T10:30:00Z"
},
… (3 more lines)絞り込み、並べ替え、ページネーション
一覧エンドポイントは limit、page、offset、sort、order、q を受け付け、任意のフィールド名を完全一致の絞り込みに使えます。件数は X-Total-Count ヘッダーで返ります。書き込みはサーバーを再起動するまでメモリに残るので、テストで自由にレコードを作成・変更・削除できます。 クエリパラメータのリファレンス.