---
title: SwitchMall Public API
description: Read-only SwitchMall product statistics and catalog data resources.
canonical_url: https://switchmall.ai/developers/api
openapi_url: https://switchmall.ai/openapi.json
---

# SwitchMall Public API

SwitchMall provides a small read-only public API. The stable REST endpoint documented here returns engagement statistics for a product. For catalog discovery tied to a concrete user request, use the SwitchMall MCP server.

## SwitchMall Product Statistics API

```http
GET https://switchmall.ai/api/public/v1/products/{productId}/stats
Accept: application/json
```

`productId` must be a positive integer. No API key or user token is required.

```bash
curl --header 'Accept: application/json' \
  'https://switchmall.ai/api/public/v1/products/12345/stats'
```

Successful response:

```json
{
  "productId": 12345,
  "viewsCount": 128,
  "likesCount": 17,
  "dislikesCount": 2
}
```

The endpoint allows cross-origin browser requests. It may return `400` for an invalid ID, `405` for an unsupported method, `429` when the public rate limit is exceeded, or `500` for an unexpected server error. A missing product ID can still have zero statistics because this endpoint does not assert catalog existence.

Error responses are JSON and contain `error`, a stable `code`, a human-readable `message`, and a concrete `resolution` hint. Existing clients can continue reading the backward-compatible `error` field.

## SwitchMall catalog data

- [SwitchMall MCP server](https://switchmall.ai/developers/mcp) — search and retrieve current products.
- [SwitchMall product showcase](https://switchmall.ai/gpt/products.json?limit=20) — a non-paginated sample of at most 20 recent products.
- [SwitchMall AI catalog manifest](https://switchmall.ai/gpt.json) — live counts and endpoint metadata.
- [SwitchMall OpenAPI specification](https://switchmall.ai/openapi.json) — OpenAPI 3.0 JSON.
- [SwitchMall OpenAPI specification in YAML](https://switchmall.ai/api/openapi.yaml) — equivalent YAML representation.

## Authentication

See [SwitchMall authentication documentation](https://switchmall.ai/developers/auth). Public resources listed above do not require credentials.

## Acceptable use and rate limits

Public interfaces are for interactive, user-requested product discovery. Catalog enumeration, mirroring, bulk ingestion, resale, republication, training-dataset creation, and attempts to evade quotas are not permitted. Rate-limited responses use HTTP `429`, include `Retry-After`, and provide a structured `RATE_LIMIT_EXCEEDED` error. Contact SwitchMall for an approved higher-volume integration.
