Quick Start
Dodo offers two modes (same API, less learning curve) tailored to different customer needs:
- Lightweight: Ideal for startups, small teams, or proof-of-concept projects without established data pipelines. Send data on-demand via simple SQL queries in API calls.
- Performance: Best for large-scale applications with established data pipelines. Sync your entity catalog via CSV files or database connections for fastest speed and real-time adaptation.
Prerequisites
Sign up at /auth page - Create your account to get instant access, no credit card required
Step 1: Get Your API Keys
Go to /auth page to get the API key for a new project. Each API key provides secure access and helps isolate your data while preventing data leaks between different users and projects.
Using Your API Key for Authorization Your API key is used for authorization when calling any Dodo services. Include it as a Bearer token in the Authorization header:
Step 2: Data Preparation
Lightweight - Simple SQL Queries to Gather Data
Skip the complex data pipelines. Just run a simple SQL query when you need recommendations, send the data to Dodo, and boom - you're done! Truly no fixed schema or rigid requirements.
For E-commerce and Retail:
-- Get user purchase history with product details
SELECT o.user_id, o.product_id, p.product_name, p.price, p.category, o.created_at
FROM orders o
JOIN products p ON o.product_id = p.product_id
WHERE o.user_id = 'your-user-id'
ORDER BY o.created_at DESC; -- Optional: skip for faster query
-- Get product catalog
SELECT product_id, product_name, price, category, description
FROM products;
Performance Mode (Advanced)
Your entity catalog is saved in a CSV/parquet file or to be streamed from database? See Sync Data for detailed setup instructions. This setup is for performance-critical applications that require instant responses and continuous learning, sync your entity catalog and interaction data.
Step 3: Get Recommendations via API
In the request body, provide:
template: The prompt template that instructs our models to suggest next product or other recommendation tasks. The template should share keys defined in context.context: The user's context data (e.g., previous purchases, budget, etc.). You can keep the same context and modify the template to fit your other usecases (say similar products that tailor to your end-user's preferences). context should be a dictionary where keys are the variables in your template and values are the corresponding data.catalog: The entity catalog that the model will use to generate recommendations. It should be a dictionary where keys are the entity IDs and values are the entity data.num_results: number of results you want to return. By default, it is 10.model_key: model name to use for recommendations. By default, parg-1. Look at models-list for available models.
Check out our industry templates for template and context examples for different industries.
Lightweight Mode - Send your data directly in the request body
No setup required!
curl -X POST "https://api.trydodo.xyz/api/recommend" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"context": {
"previous_purchases": [
{
"product_name": "iPhone 16 512Gb",
"price": 999,
"category": "electronics"
},
{
"product_name": "Rich Dad Poor Dad book",
"price": 10,
"category": "books"
}
],
"budget": 100.0
},
"catalog": {
"8": {"product_name": "MacBook Pro", "price": 1999, "category": "electronics"},
"4": {"product_name": "iPad Air", "price": 599, "category": "electronics"},
"1": {"product_name": "iPhone 16", "price": 999, "category": "electronics"},
"3": {"product_name": "AirPods Pro", "price": 249, "category": "electronics"},
"5": {"product_name": "Apple Watch", "price": 399, "category": "electronics"},
"6": {"product_name": "Magic Keyboard", "price": 149, "category": "electronics"},
"9": {"product_name": "Magic Mouse", "price": 99, "category": "electronics"},
"7": {"product_name": "Magic Trackpad", "price": 129, "category": "electronics"},
"2": {"product_name": "Apple Pencil", "price": 129, "category": "electronics"},
"10": {"product_name": "USB-C Charge Cable", "price": 19, "category": "accessories"}
},
"template": "Recommend the next product based on the user'\''s purchase history: {context}. Suggest items under $100 that complement these purchases."
}'
Response:
{
"status_code": 200, # successful recommendations
"decision_id": "decision_id", # unique identifier for this recommendation
"results": ["10","9","1","3","5","6","7","2","4"]
}
Performance Mode - (Advanced)
For faster speed and real-time adaptation, sync your entity catalog and interaction data. See Recommendation API docs for more details.
Optimize Context and Template
For detailed guidance on optimizing your context and template, see Optimize Performance.
Step 5: Track Feedback Signals and Analysis (coming soon)
Either calls to our endpoint
curl -X POST "https://api.trydodo.xyz/api/feedback/track?project_id=${PROJECT_ID}" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"project_id": "project_id",
"decision_id": "decision_id",
"feedback": "positive", # "positive" or "negative"
"created_at": "2025-10-24T00:00:00Z" # UTC timezone
}'
Or install SDKs and capture end-user interactions to improve decisions (coming soon):
pip install dodo-decisions
# or
npm install @dodo/sdk
Python SDK:
import dodo
# Initialize SDK
client = dodo.Client(api_key="api_key")
# Track user interactions
client.track({
"user_id": "user123",
"decision_id": "dec_123456",
"context": {
"item_id": "warm-sweater-123",
"page": "product_detail",
"event": "product_view" # free-form text, no predefined schema
}
})
# Track purchase/conversion
client.track({
"user_id": "user123",
"decision_id": "dec_123456",
"context": {
"page": "product_detail_page",
"event": "purchase" # free-form text, no predefined schema
"item_id": "warm-sweater-123",
"value": 89.99,
}
})
JavaScript SDK:
import { DodoClient } from '@dodo/sdk';
const dodo = new DodoClient('your-api-key');
// Track click events for media website
dodo.track('click', {
user_id: 'user123',
context: {
"page": "next_articles",
"article_id": "ai-articles-123",
"event": "product_view" # free-form text, no predefined schema
}
});
// Track travel conversion with decision_id
dodo.track('purchase', {
user_id: 'user123',
decision_id: "dec_123456",
context: {
"item_id": "ai-travel-123",
"page": "home_page",
"event": "purchase" # free-form text, no predefined schema
}
});
## Next Steps
For advanced optimization and performance monitoring (future features), see [Optimize Performance](./optimize.md).