API Reference

Marketplace Endpoints

Marketplace Endpoints

The marketplace endpoints provide access to Spartera's analytics
marketplace where data providers share their analytics and consumers
discover and purchase analytical capabilities. These endpoints support
browsing, purchasing, and managing marketplace transactions.

Analytics Discovery

List Available Analytics

Browse all publicly available analytics in the marketplace.

GET /marketplace/analytics

List Available Analytics Query Parameters

  • category (optional): Filter by analytics category
  • industry (optional): Filter by target industry
  • price_range (optional): Price range filter (e.g., "0-100")
  • rating (optional): Minimum rating filter (1-5)
  • search (optional): Search term for analytics name or description
  • sort (optional): Sort order (popularity, price, rating, newest)
  • limit (optional): Number of results per page (default: 20)
  • offset (optional): Pagination offset (default: 0)

List Available Analytics Response

{
  "data": [
    {
      "analytics_id": "analytics_123",
      "name": "Customer Lifetime Value Predictor",
      "description": "Advanced ML model for predicting CLV",
      "provider": {
        "company_id": "provider_456",
        "name": "DataInsights Corp",
        "verified": true,
        "rating": 4.8
      },
      "category": "machine_learning",
      "industries": ["retail", "e-commerce", "saas"],
      "pricing": {
        "model": "per_request",
        "price": 2.50,
        "currency": "USD",
        "free_tier": {
          "requests": 100,
          "period": "monthly"
        }
      },
      "metrics": {
        "accuracy": 0.94,
        "response_time_ms": 150,
        "uptime": 99.8,
        "total_requests": 150000
      },
      "tags": ["prediction", "customer", "machine_learning"],
      "rating": 4.6,
      "reviews_count": 127,
      "created_at": "2024-06-15T10:00:00Z",
      "updated_at": "2025-01-15T14:30:00Z"
    }
  ],
  "meta": {
    "total": 847,
    "page": 1,
    "per_page": 20,
    "filters_applied": {
      "category": "machine_learning",
      "industry": "retail"
    }
  }
}

Get Analytics Details

Retrieve detailed information about a specific analytics offering.

GET /marketplace/analytics/{analytics_id}

Get Analytics Details Parameters

  • analytics_id (path, required): Unique identifier for the analytics

Get Analytics Details Response

{
  "data": {
    "analytics_id": "analytics_123",
    "name": "Customer Lifetime Value Predictor",
    "description": "Advanced machine learning model that predicts customer lifetime value using behavioral patterns, transaction history, and demographic data.",
    "provider": {
      "company_id": "provider_456",
      "name": "DataInsights Corp",
      "description": "Leading provider of predictive analytics",
      "verified": true,
      "rating": 4.8,
      "analytics_count": 23,
      "total_customers": 890
    },
    "category": "machine_learning",
    "subcategory": "predictive_modeling",
    "industries": ["retail", "e-commerce", "saas", "telecommunications"],
    "use_cases": [
      "Marketing budget optimization",
      "Customer segmentation",
      "Churn prevention",
      "Revenue forecasting"
    ],
    "pricing": {
      "model": "per_request",
      "price": 2.50,
      "currency": "USD",
      "billing_cycle": "monthly",
      "free_tier": {
        "requests": 100,
        "period": "monthly",
        "features": "basic"
      },
      "enterprise_pricing": {
        "available": true,
        "contact_required": true
      }
    },
    "technical_specs": {
      "input_format": "json",
      "output_format": "json",
      "max_batch_size": 1000,
      "average_response_time": "150ms",
      "sla_uptime": "99.9%"
    },
    "data_requirements": [
      "Customer transaction history (minimum 6 months)",
      "Customer demographic information",
      "Product/service interaction data"
    ],
    "metrics": {
      "accuracy": 0.94,
      "precision": 0.91,
      "recall": 0.89,
      "f1_score": 0.90,
      "response_time_ms": 150,
      "uptime": 99.8,
      "total_requests": 150000,
      "satisfied_customers": 245
    },
    "documentation": {
      "api_reference": "/docs/analytics/analytics_123/api",
      "integration_guide": "/docs/analytics/analytics_123/integration",
      "use_case_examples": "/docs/analytics/analytics_123/examples"
    },
    "reviews": {
      "average_rating": 4.6,
      "total_reviews": 127,
      "rating_distribution": {
        "5": 68,
        "4": 41,
        "3": 15,
        "2": 2,
        "1": 1
      }
    },
    "tags": ["prediction", "customer", "machine_learning", "clv"],
    "created_at": "2024-06-15T10:00:00Z",
    "updated_at": "2025-01-15T14:30:00Z",
    "trial_available": true,
    "support_level": "premium"
  }
}

Search Analytics

Search for analytics using advanced filtering and text search.

POST /marketplace/analytics/search

Search Analytics Request Body

{
  "query": "customer segmentation machine learning",
  "filters": {
    "categories": ["machine_learning", "business_intelligence"],
    "industries": ["retail", "e-commerce"],
    "price_range": {
      "min": 0,
      "max": 10
    },
    "rating_min": 4.0,
    "has_free_tier": true,
    "provider_verified": true,
    "response_time_max": 500
  },
  "sort": [
    {"field": "relevance", "order": "desc"},
    {"field": "rating", "order": "desc"}
  ],
  "limit": 50,
  "offset": 0
}

Search Analytics Response

{
  "data": [
    {
      "analytics_id": "analytics_789",
      "name": "Advanced Customer Segmentation",
      "relevance_score": 0.95,
      "match_highlights": [
        "Advanced <em>customer segmentation</em> using <em>machine learning</em>",
        "Behavioral clustering and demographic analysis"
      ],
      "provider": {
        "name": "ML Analytics Pro",
        "verified": true
      },
      "pricing": {
        "price": 1.75,
        "model": "per_request"
      },
      "rating": 4.7,
      "category": "machine_learning"
    }
  ],
  "meta": {
    "total_results": 23,
    "search_time_ms": 45,
    "query_processed": "customer segmentation machine learning"
  }
}

Analytics Purchasing

Purchase Analytics Access

Purchase access to analytics offerings in the marketplace.

POST /marketplace/analytics/{analytics_id}/purchase

Purchase Analytics Access Parameters

  • analytics_id (path, required): Analytics identifier

Purchase Analytics Access Request Body

{
  "plan": "professional",
  "billing_cycle": "monthly",
  "quantity": 1,
  "payment_method": "card_123",
  "auto_renewal": true,
  "promotional_code": "NEWUSER20"
}

Purchase Analytics Access Response

{
  "data": {
    "purchase_id": "purchase_456",
    "analytics_id": "analytics_123",
    "status": "completed",
    "access_granted": true,
    "plan_details": {
      "plan": "professional",
      "requests_included": 10000,
      "billing_cycle": "monthly",
      "price": 49.99,
      "currency": "USD"
    },
    "access_credentials": {
      "api_key": "ak_live_analytics123_xyz789",
      "endpoint": "https://api.spartera.com/analytics/analytics_123"
    },
    "billing": {
      "next_billing_date": "2025-02-20T00:00:00Z",
      "auto_renewal": true
    },
    "purchased_at": "2025-01-20T15:45:00Z",
    "expires_at": "2025-02-20T15:45:00Z"
  }
}

Get Purchase History

Retrieve purchase history for the authenticated user.

GET /marketplace/purchases

Get Purchase History Query Parameters

  • status (optional): Filter by purchase status
  • analytics_id (optional): Filter by specific analytics
  • start_date (optional): Filter purchases from date
  • end_date (optional): Filter purchases to date
  • limit (optional): Results per page
  • offset (optional): Pagination offset

Get Purchase History Response

{
  "data": [
    {
      "purchase_id": "purchase_456",
      "analytics": {
        "analytics_id": "analytics_123",
        "name": "Customer Lifetime Value Predictor",
        "provider": "DataInsights Corp"
      },
      "plan": "professional",
      "status": "active",
      "purchased_at": "2025-01-20T15:45:00Z",
      "expires_at": "2025-02-20T15:45:00Z",
      "usage": {
        "requests_used": 2456,
        "requests_included": 10000,
        "overage_charges": 0
      },
      "billing": {
        "amount": 49.99,
        "currency": "USD",
        "next_billing": "2025-02-20T00:00:00Z"
      }
    }
  ],
  "meta": {
    "total": 15,
    "active_subscriptions": 8,
    "total_spent": 1247.83
  }
}

Start Free Trial

Initiate a free trial for analytics that offer trial periods.

POST /marketplace/analytics/{analytics_id}/trial

Start Free Trial Parameters

  • analytics_id (path, required): Analytics identifier

Start Free Trial Request Body

{
  "trial_type": "standard",
  "intended_use_case": "Evaluating for customer segmentation project",
  "estimated_volume": "1000_requests_monthly"
}

Response

{
  "data": {
    "trial_id": "trial_789",
    "analytics_id": "analytics_123",
    "status": "active",
    "trial_details": {
      "duration_days": 14,
      "requests_included": 1000,
      "features": ["basic_analytics", "standard_support"]
    },
    "access_credentials": {
      "api_key": "ak_trial_analytics123_abc456",
      "endpoint": "https://api.spartera.com/analytics/analytics_123"
    },
    "started_at": "2025-01-20T16:00:00Z",
    "expires_at": "2025-02-03T16:00:00Z",
    "restrictions": [
      "Limited to 1000 requests total",
      "No commercial usage allowed",
      "Basic support only"
    ]
  }
}

Reviews and Ratings

Submit Analytics Review

Submit a review and rating for purchased analytics.

POST /marketplace/analytics/{analytics_id}/reviews

Submit Analytics Review Parameters

  • analytics_id (path, required): Analytics identifier

Submit Analytics Review Parameters Request Body

{
  "rating": 5,
  "title": "Excellent accuracy and fast response times",
  "review": "This analytics has significantly improved our customer segmentation efforts. The accuracy is outstanding and integration was straightforward.",
  "aspects": {
    "accuracy": 5,
    "speed": 5,
    "documentation": 4,
    "support": 5,
    "ease_of_use": 4
  },
  "recommend": true,
  "use_case": "customer_segmentation",
  "company_size": "medium"
}

Submit Analytics Review Parameters Response

{
  "data": {
    "review_id": "review_123",
    "analytics_id": "analytics_123",
    "rating": 5,
    "title": "Excellent accuracy and fast response times",
    "status": "published",
    "submitted_at": "2025-01-20T16:15:00Z",
    "helpful_votes": 0,
    "verified_purchase": true
  }
}

Get Analytics Reviews

Retrieve reviews for specific analytics.

GET /marketplace/analytics/{analytics_id}/reviews

Get Analytics Reviews Parameters

  • analytics_id (path, required): Analytics identifier

Get Analytics Reviews Query Parameters

  • rating (optional): Filter by rating (1-5)
  • sort (optional): Sort order (newest, oldest, helpful, rating)
  • verified_only (optional): Show only verified purchase reviews
  • limit (optional): Results per page
  • offset (optional): Pagination offset

Get Analytics Reviews Response

{
  "data": [
    {
      "review_id": "review_123",
      "reviewer": {
        "name": "DataAnalyst_User",
        "verified_purchaser": true,
        "review_count": 23,
        "helpful_votes": 145
      },
      "rating": 5,
      "title": "Excellent accuracy and fast response times",
      "review": "This analytics has significantly improved our customer segmentation efforts...",
      "aspects": {
        "accuracy": 5,
        "speed": 5,
        "documentation": 4,
        "support": 5,
        "ease_of_use": 4
      },
      "submitted_at": "2025-01-20T16:15:00Z",
      "helpful_votes": 12,
      "use_case": "customer_segmentation",
      "company_size": "medium"
    }
  ],
  "meta": {
    "total_reviews": 127,
    "average_rating": 4.6,
    "rating_distribution": {
      "5": 68,
      "4": 41,
      "3": 15,
      "2": 2,
      "1": 1
    }
  }
}

Provider Analytics

List Your Published Analytics

Get analytics published by your company (for providers).

GET /marketplace/my-analytics

List Your Published Analytics Query Parameters

  • status (optional): Filter by analytics status
  • category (optional): Filter by category
  • sort (optional): Sort order
  • limit (optional): Results per page
  • offset (optional): Pagination offset

List Your Published Analytics Response

{
  "data": [
    {
      "analytics_id": "analytics_456",
      "name": "Sales Forecasting Model",
      "status": "published",
      "category": "forecasting",
      "pricing": {
        "price": 3.75,
        "model": "per_request"
      },
      "metrics": {
        "total_customers": 45,
        "monthly_revenue": 2850.00,
        "total_requests": 75000,
        "rating": 4.3
      },
      "created_at": "2024-09-12T08:30:00Z",
      "last_updated": "2025-01-10T11:20:00Z"
    }
  ],
  "meta": {
    "total": 8,
    "published": 6,
    "draft": 2,
    "total_monthly_revenue": 8945.50
  }
}

Analytics Performance Metrics

Get detailed performance metrics for your published analytics.

GET /marketplace/analytics/{analytics_id}/metrics

Analytics Performance Metrics Parameters

  • analytics_id (path, required): Analytics identifier

Analytics Performance Metrics Query Parameters

  • period (optional): Time period (7d, 30d, 90d, 1y)
  • granularity (optional): Data granularity (daily, weekly, monthly)

Analytics Performance Metrics Response

{
  "data": {
    "analytics_id": "analytics_456",
    "period": "30d",
    "summary": {
      "total_revenue": 2850.00,
      "total_requests": 8500,
      "unique_customers": 45,
      "average_rating": 4.3,
      "conversion_rate": 0.12
    },
    "time_series": [
      {
        "date": "2025-01-20",
        "requests": 285,
        "revenue": 95.50,
        "new_customers": 2
      }
    ],
    "customer_breakdown": {
      "by_plan": {
        "free": 15,
        "professional": 25,
        "enterprise": 5
      },
      "by_industry": {
        "retail": 18,
        "technology": 12,
        "finance": 10,
        "healthcare": 5
      }
    },
    "geographic_distribution": {
      "north_america": 60,
      "europe": 25,
      "asia_pacific": 12,
      "other": 3
    }
  }
}

Marketplace Categories

Get All Categories

Retrieve all available analytics categories in the marketplace.

GET /marketplace/categories

Get All Categories Response

{
  "data": [
    {
      "category_id": "machine_learning",
      "name": "Machine Learning",
      "description": "Predictive models and AI-powered analytics",
      "subcategories": [
        "classification",
        "regression",
        "clustering",
        "deep_learning"
      ],
      "analytics_count": 245,
      "popular_tags": ["prediction", "classification", "nlp"]
    },
    {
      "category_id": "business_intelligence",
      "name": "Business Intelligence",
      "description": "Dashboards, reports, and business metrics",
      "subcategories": [
        "dashboards",
        "reporting",
        "kpi_tracking"
      ],
      "analytics_count": 167,
      "popular_tags": ["dashboard", "reporting", "metrics"]
    }
  ]
}

The marketplace endpoints enable comprehensive interaction with
Spartera's analytics marketplace, from discovery and evaluation to
purchase and ongoing management of analytics subscriptions.