Generate API keys, stream data programmatically, and integrate dataTamer into your applications.
⚠️ Important: Copy your API key immediately! You won't be able to see it again. Store it securely in environment variables.
Store your API key in environment variables:
# .env file DATATAMER_API_KEY=your_api_key_here DATATAMER_API_URL=https://app.datatamer.ai/api
Add .env to your .gitignore file
All API requests require authentication using Bearer token:
curl -X GET https://app.datatamer.ai/api/v1/topics \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
Common Endpoints:
GET /api/v1/topics - List topicsGET /api/v1/datasources - List datasourcesPOST /api/v1/tamed-data/:id/stream - Stream dataPOST /api/v1/tamed-data/:id/search - RAG searchJavaScript/TypeScript (Node.js):
npm install @datatamer/sdk # or yarn add @datatamer/sdk
Python:
pip install datatamer-sdk
JavaScript/TypeScript:
import { DataTamerClient } from '@datatamer/sdk';
const client = new DataTamerClient({
apiKey: process.env.DATATAMER_API_KEY,
apiUrl: 'https://app.datatamer.ai/api'
});Python:
from datatamer import DataTamerClient
import os
client = DataTamerClient(
api_key=os.getenv('DATATAMER_API_KEY'),
api_url='https://app.datatamer.ai/api'
)JavaScript Example:
const tamedDataId = 'td_789';
// Stream a single record
await client.tamedData.stream(tamedDataId, {
event: 'user_signup',
user_id: '12345',
email: '[email protected]',
timestamp: new Date().toISOString()
});
// Stream multiple records
const records = [
{ event: 'page_view', page: '/home' },
{ event: 'purchase', product: 'Widget' }
];
await client.tamedData.streamBatch(tamedDataId, records);Python Example:
tamed_data_id = 'td_789'
# Stream a single record
client.tamed_data.stream(tamed_data_id, {
'event': 'user_signup',
'user_id': '12345',
'email': '[email protected]'
})
# Stream multiple records
records = [
{'event': 'page_view', 'page': '/home'},
{'event': 'purchase', 'product': 'Widget'}
]
client.tamed_data.stream_batch(tamed_data_id, records)JavaScript Example:
const results = await client.tamedData.search(tamedDataId, {
query: 'What are the top features requested by users?',
topK: 10,
includeAnswer: true
});
console.log('AI Answer:', results.answer);
console.log('Source Documents:', results.results);Python Example:
results = client.tamed_data.search(tamed_data_id,
query='What are the top features requested?',
top_k=10,
include_answer=True
)
print('AI Answer:', results['answer'])
print('Source Documents:', results['results'])You've completed all dataTamer tutorials! You now know how to upload data, connect databases, search code, create rules, and integrate via API.