Skip to content
cresvaDevelopers

A ready to run cURL quickstart

GET/api/storefront/sdk/curl
No keyCallable anonymously. Rate limited by IP.10 requests a minute

Request

bash
curl "https://cresva.ai/api/storefront/sdk/curl"

Response

Captured from production on 2026-09-16: 200 in 190ms. This is what the endpoint returned, not an example of what it might.

JSON
# Cresva Storefront API cURL Examples
# Replace YOUR_API_KEY and YOUR_BRAND_ID with your actual values.

BASE_URL="https://cresva.ai/api/storefront/YOUR_BRAND_ID"
API_KEY="pk_live_your_key_here"

# ──────────────────────────────────────────
# Search products
# ──────────────────────────────────────────
curl -s -H "Authorization: Bearer $API_KEY" \
  "$BASE_URL/search?q=organic+cotton+tshirt&limit=10"

# ──────────────────────────────────────────
# List products (paginated)
# ──────────────────────────────────────────
curl -s -H "Authorization: Bearer $API_KEY" \
  "$BASE_URL/products?limit=20&page=1"

# ──────────────────────────────────────────
# Get product details
# ──────────────────────────────────────────
curl -s -H "Authorization: Bearer $API_KEY" \
  "$BASE_URL/products/prod_abc123"

# ──────────────────────────────────────────
# Get recommendations
# Valid types: similar_to, alternative_to, pairs_with,
# variant_of, complement, upgrade_from, good_for
# ──────────────────────────────────────────
curl -s -H "Authorization: Bearer $API_KEY" \
  "$BASE_URL/recommend?product_id=prod_abc&type=similar_to"

# ──────────────────────────────────────────
# Compare products (2 to 5 IDs)
# ──────────────────────────────────────────
curl -s -H "Authorization: Bearer $API_KEY" \
  "$BASE_URL/compare?ids=prod_1,prod_2,prod_3"

# ──────────────────────────────────────────
# Get product reviews
# ──────────────────────────────────────────
curl -s -H "Authorization: Bearer $API_KEY" \
  "$BASE_URL/reviews/prod_abc123"

# ──────────────────────────────────────────
# Full Agent Query Protocol request
# ──────────────────────────────────────────
curl -s -X POST "$BASE_URL/query" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "protocol_version": "1.0",
    "request_id": "example-001",
    "timestamp": "2026-03-26T00:00:00Z",
    "agent": { "platform": "curl", "version": "1.0" },
    "query": {
      "text": "wireless headphones under $100",
      "intent": "search",
      "filters": { "price_max": 100, "in_stock": true }
    },
    "pagination": { "page": 1, "limit": 10 }
  }'

# ──────────────────────────────────────────
# Health check (platform-wide, not brand-scoped)
# ──────────────────────────────────────────
curl -s "https://cresva.ai/api/storefront/health"

Response codes

200Text.
string
401The key does not match any active key.
erroranyTwo shapes exist across this API and that is deliberate rather than untidy. Each route kept the error shape it already used, so an existing client's error handling keeps working. See x-cresva-error-shapes.
403The key is valid but belongs to a different brand than the one in the path. Keys are scoped to one brand and do not travel.
erroranyTwo shapes exist across this API and that is deliberate rather than untidy. Each route kept the error shape it already used, so an existing client's error handling keeps working. See x-cresva-error-shapes.
404No such brand.
erroranyTwo shapes exist across this API and that is deliberate rather than untidy. Each route kept the error shape it already used, so an existing client's error handling keeps working. See x-cresva-error-shapes.
429Over the rate limit.
erroranyTwo shapes exist across this API and that is deliberate rather than untidy. Each route kept the error shape it already used, so an existing client's error handling keeps working. See x-cresva-error-shapes.
503The rate limiter could not be reached, so the request was refused rather than served unmetered. Deliberately not a 429: the caller has done nothing wrong and the fault is ours.
erroranyTwo shapes exist across this API and that is deliberate rather than untidy. Each route kept the error shape it already used, so an existing client's error handling keeps working. See x-cresva-error-shapes.

Generated from the storefront OpenAPI document at growthagents 269d7898b, sha256 047fe4d301258100. Nothing on this page was typed by hand.