When integrating Tweakwise into your e-commerce stack, you will encounter multiple APIs. You might be wondering: which API do I need for my specific use case?
By the end of this guide, you will know exactly which API to target for frontend performance, data tracking, or instance management.
API Breakdown
Depending on what you are building, you will use different endpoints. Here is a breakdown of the four main APIs.
1. Delivery API
This is your primary tool for frontend integration. It handles all customer-facing features like Smart Search, Commerce Pages (listers), and Recommendations.
- Goal: Optimized for maximum speed and low latency.
- Use case: Fetching search results, rendering product listing pages, or loading personalized recommendations on your storefront.
- Quick start: Discover the relevant Essentials.
2. Analytics API
Part of your frontend integration, this API works closely alongside the Delivery API.
- Goal: Collect e-commerce signals to fuel Tweakwise's data-driven algorithms (like personalization and popular product ranking).
- Use case: Tracking user behavior on your storefront, such as page views, clicks, add-to-carts, and completed transactions.
3. Backend API
This is the modern API for instance management. You do not use this on your storefront.
- Goal: Manage your Tweakwise environment programmatically.
- Use case: Creating or updating merchandising rules, triggering data syncs, or configuring instance settings from your backend systems.
- Quick start: Discover the relevant Essentials.
4. Backend API (legacy)
This is the legacy API for instance management.
- Goal: Maintained for older integrations, but replaced by the Backend API.
- Use case: You should avoid this for new projects. If you are maintaining an older integration, plan a migration to the Backend API.
MCP & Agentic Workflows
Learn more about using the Tweakwise Backend API for Agentic Workflows.
Notes & Important Considerations
- Frontend Security: Never expose your Backend API or Backend API keys in your frontend code. Only use the Delivery API and Analytics API keys in client-side applications.
- Performance: Keep the Delivery API calls as direct as possible. Avoid routing Delivery API requests through your own backend middleware if it adds unnecessary latency, as this defeats the API's speed optimizations.
- Deprecation Warning: If you are starting a fresh build, completely ignore the Backend API. Focus your backend automation efforts entirely on the Backend API.
FAQ
Q: Which API should I use to build a custom search autocomplete?
You need the Delivery API. It is specifically optimized to return search suggestions and results at the speed required for a snappy autocomplete experience.
Q: Why are my product recommendations not personalizing based on user behavior?
You are likely missing the Analytics API integration. The Delivery API serves the recommendations, but the Analytics API needs to capture user events (views, purchases) to inform the personalization engine.
Q: Can I use the Backend API to fetch product lists for a mobile app?
No. The Backend API is for managing your Tweakwise instance configuration. To fetch product lists or search results for a mobile app, use the Delivery API.