API Reference
API Reference
Section titled “API Reference”Base URL
Section titled “Base URL”https://api.strike48.com/v1Authentication
Section titled “Authentication”All API requests require authentication using an API key. You can generate API keys from your account dashboard.
Header Authentication
Section titled “Header Authentication”curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.strike48.com/v1/datasetsQuery Parameter Authentication
Section titled “Query Parameter Authentication”curl https://api.strike48.com/v1/datasets?api_key=YOUR_API_KEYRate Limiting
Section titled “Rate Limiting”Rate limits vary by plan:
- Starter: 1,000 requests/hour
- Professional: 10,000 requests/hour
- Business: 100,000 requests/hour
- Enterprise: Unlimited
Rate limit headers:
X-RateLimit-Limit: 1000X-RateLimit-Remaining: 999X-RateLimit-Reset: 1640995200Endpoints
Section titled “Endpoints”Datasets
Section titled “Datasets”List Datasets
Section titled “List Datasets”GET /datasetsResponse:
{ "datasets": [ { "id": "ds_123", "name": "Sales Data", "created_at": "2024-01-01T00:00:00Z", "rows": 1000000, "size_bytes": 50000000 } ], "total": 10, "page": 1}Get Dataset
Section titled “Get Dataset”GET /datasets/{dataset_id}Create Dataset
Section titled “Create Dataset”POST /datasetsContent-Type: application/json
{ "name": "Sales Data", "description": "Monthly sales records", "schema": { "fields": [ {"name": "date", "type": "date"}, {"name": "amount", "type": "decimal"}, {"name": "product", "type": "string"} ] }}Update Dataset
Section titled “Update Dataset”PUT /datasets/{dataset_id}Delete Dataset
Section titled “Delete Dataset”DELETE /datasets/{dataset_id}Queries
Section titled “Queries”Execute Query
Section titled “Execute Query”POST /queryContent-Type: application/json
{ "sql": "SELECT * FROM sales WHERE amount > 1000", "dataset_id": "ds_123", "timeout": 30, "cache": true}Response:
{ "query_id": "q_456", "status": "completed", "rows": 500, "execution_time_ms": 245, "data": [ {"date": "2024-01-01", "amount": 1500, "product": "Widget"}, {"date": "2024-01-02", "amount": 2000, "product": "Gadget"} ], "metadata": { "fields": [ {"name": "date", "type": "date"}, {"name": "amount", "type": "decimal"}, {"name": "product", "type": "string"} ] }}Get Query Status
Section titled “Get Query Status”GET /query/{query_id}/statusCancel Query
Section titled “Cancel Query”POST /query/{query_id}/cancelDashboards
Section titled “Dashboards”List Dashboards
Section titled “List Dashboards”GET /dashboardsGet Dashboard
Section titled “Get Dashboard”GET /dashboards/{dashboard_id}Create Dashboard
Section titled “Create Dashboard”POST /dashboardsContent-Type: application/json
{ "name": "Sales Dashboard", "description": "Monthly sales overview", "widgets": [ { "type": "chart", "position": {"x": 0, "y": 0, "w": 6, "h": 4}, "config": { "query": "SELECT date, SUM(amount) FROM sales GROUP BY date", "chart_type": "line", "title": "Sales Trend" } } ]}Update Dashboard
Section titled “Update Dashboard”PUT /dashboards/{dashboard_id}Delete Dashboard
Section titled “Delete Dashboard”DELETE /dashboards/{dashboard_id}Share Dashboard
Section titled “Share Dashboard”POST /dashboards/{dashboard_id}/share
{ "users": ["user@example.com"], "permission": "view", "expires_at": "2024-12-31T23:59:59Z"}Visualizations
Section titled “Visualizations”Create Visualization
Section titled “Create Visualization”POST /visualizationsContent-Type: application/json
{ "name": "Revenue Chart", "type": "bar", "query_id": "q_456", "config": { "x_axis": "month", "y_axis": "revenue", "color": "category" }}Export Visualization
Section titled “Export Visualization”GET /visualizations/{viz_id}/export?format=pngSupported formats: png, svg, pdf, csv
Machine Learning
Section titled “Machine Learning”List Models
Section titled “List Models”GET /ml/modelsTrain Model
Section titled “Train Model”POST /ml/models/train
{ "name": "Sales Predictor", "type": "regression", "dataset_id": "ds_123", "target": "amount", "features": ["date", "product", "region"], "config": { "algorithm": "random_forest", "hyperparameters": { "n_estimators": 100, "max_depth": 10 } }}Get Model Status
Section titled “Get Model Status”GET /ml/models/{model_id}/statusMake Prediction
Section titled “Make Prediction”POST /ml/models/{model_id}/predict
{ "data": [ {"date": "2024-12-01", "product": "Widget", "region": "North"} ]}Deploy Model
Section titled “Deploy Model”POST /ml/models/{model_id}/deploy
{ "name": "production-sales-predictor", "auto_retrain": true, "retrain_schedule": "0 0 * * 0"}Data Import/Export
Section titled “Data Import/Export”Import Data
Section titled “Import Data”POST /data/import
{ "dataset_id": "ds_123", "source": { "type": "s3", "bucket": "my-bucket", "key": "data/sales.csv" }, "format": "csv", "options": { "header": true, "delimiter": "," }}Export Data
Section titled “Export Data”POST /data/export
{ "dataset_id": "ds_123", "destination": { "type": "s3", "bucket": "my-bucket", "key": "exports/sales.parquet" }, "format": "parquet"}WebSocket API
Section titled “WebSocket API”Real-time Data Stream
Section titled “Real-time Data Stream”const ws = new WebSocket('wss://api.strike48.com/v1/stream');
ws.onopen = () => { ws.send(JSON.stringify({ action: 'subscribe', dataset_id: 'ds_123', filters: { amount: {'>': 1000} } }));};
ws.onmessage = (event) => { const data = JSON.parse(event.data); console.log('New data:', data);};Webhooks
Section titled “Webhooks”Create Webhook
Section titled “Create Webhook”POST /webhooks
{ "url": "https://your-app.com/webhook", "events": ["query.completed", "dataset.updated"], "secret": "your-webhook-secret"}List Webhooks
Section titled “List Webhooks”GET /webhooksDelete Webhook
Section titled “Delete Webhook”DELETE /webhooks/{webhook_id}Error Responses
Section titled “Error Responses”{ "error": { "code": "INVALID_QUERY", "message": "Syntax error in SQL query", "details": "Unexpected token 'SELCT' at line 1, column 1", "request_id": "req_789" }}Common error codes:
AUTHENTICATION_FAILED- Invalid API keyRATE_LIMIT_EXCEEDED- Too many requestsINVALID_REQUEST- Malformed requestRESOURCE_NOT_FOUND- Resource doesn’t existPERMISSION_DENIED- Insufficient permissionsINTERNAL_ERROR- Server error
Official SDKs available:
GraphQL API
Section titled “GraphQL API”Access our GraphQL endpoint at:
https://api.strike48.com/graphqlInteractive playground available at:
https://api.strike48.com/graphql/playgroundPostman Collection
Section titled “Postman Collection”Download our Postman collection: Prospector Studio API Collection
Support
Section titled “Support”- Documentation: docs.strike48.com
- Status Page: status.strike48.com
- Support: support@strike48.com