Skip to content
Documentation · v2.1

Everything the API does, one scroll away.

Copy-paste quickstarts, a full OpenAPI reference, and working examples in Python, JavaScript, and cURL.

# 1. Exchange client credentials for a bearer token (server-side only).
export TOKEN=$(curl -s https://search.trooply.ai/oauth/token \
  -H "Content-Type: application/json" \
  -d '{"client_id":"'$CLIENT_ID'","client_secret":"'$CLIENT_SECRET'"}' \
  | jq -r .access_token)

# 2. Index a product (JSON, image_url is the canonical path).
curl -X POST https://search.trooply.ai/v1/products \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"SKU-48120","image_url":"https://cdn.shop.com/bag.jpg","metadata":{"name":"Marla Tote","price":189,"category":"Handbags"}}'

# 3. Search by text.
curl https://search.trooply.ai/v1/search/text \
  -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query":"red tote","limit":10}'

Minimum viable integration

Seven endpoints, one afternoon.

A working integration between your ecommerce platform and Trooply needs these endpoints — nothing else. The rest of the API reference is optional enhancements and merchant-portal APIs your platform code shouldn't be calling directly.

  • POST /oauth/tokenServer-side only. Returns a bearer token. Never ship client_secret to the browser.
  • POST /v1/productsIndex a product on create / image change.
  • PUT /v1/products/{id}Update on metadata change (price, rename, new image).
  • DELETE /v1/products/{id}Remove on product delete. Per-product only — the collection-level delete isn't exposed.
  • POST /v1/products/bulk + GET /v1/jobs/{id}Initial catalog sync. Kick off the job, poll until status=="completed".
  • POST /v1/search/textStorefront keyword search (use /v1/search/url for image uploads, /v1/search for multipart file uploads).
  • POST /v1/widget/search/*Alternative to writing your own UI — use our drop-in widget with a pk_live_ public key.
Optional enhancements

Ship the seven above first. Add these as your product roadmap allows — each is independently useful, none block a launch.

  • /v1/search/suggestions — autocomplete as the shopper types.
  • /v1/search/feedback — click / purchase signals improve ranking over time.
  • /v1/search/similar/{id} — "More like this" on a product detail page.
  • /v1/products/facets — values to populate filter sidebars.
  • /v1/search/voice — speech → search for mobile-first stores.
  • /v1/search/crop, /multi-image, /fusion — advanced visual shopping flows.
  • /v1/ai/search/nl, /v1/ai/search/parse — natural-language filter parsing.

Not in the reference, by design: custom-fields, search-config, merchandising, widget-keys and promo-banner CRUD are merchant-portal workflows — managed at /portal, not from platform code. Same goes for analytics, batch search, and the OpenAI-compatible chat proxy.