Developer API

Build with Luska API

Integrate competitive pricing intelligence directly into your applications with our powerful API.

Real-time Data

Access live competitor pricing data with sub-second latency.

Secure Authentication

API keys with granular permissions and rate limiting.

Historical Data

Query price history going back 12 months.

RESTful JSON API

Clean, predictable endpoints that fit any stack.

Quick Start

Fetch competitor prices

curl -X GET "https://api.luska.ai/v1/products" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

# Response
{
  "products": [
    {
      "id": "prod_abc123",
      "name": "My Product",
      "current_price": 29.99,
      "currency": "USD"
    }
  ],
  "count": 1
}

Available Endpoints

GET
/v1/productsList all products
GET
/v1/products/:id/competitorsGet competitor prices
GET
/v1/products/:id/historyGet price history
POST
/v1/productsCreate a product
POST
/v1/recommendationsGet AI pricing recommendations
GET
/v1/products/:id/salesGet sales history
POST
/v1/products/:id/salesAdd sales data

Sales Data API

Push sales data from your ERP, POS, or analytics platform to improve AI recommendations, elasticity estimates, and demand forecasts.

POST /v1/products/:id/sales

Add sales data for a product. Requires write permission.

curl -X POST "https://api.luska.ai/v1/products/PRODUCT_ID/sales" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "period_start": "2025-01-01",
    "period_end": "2025-01-31",
    "units_sold": 150,
    "price_at_time": 29.99,
    "revenue": 4498.50
  }'

# Response (201 Created)
{
  "sale": {
    "id": "uuid",
    "product_id": "uuid",
    "units_sold": 150,
    "price_at_time": 29.99,
    "revenue": 4498.50,
    "period_start": "2025-01-01T00:00:00Z",
    "period_end": "2025-01-31T00:00:00Z",
    "source": "api"
  }
}

GET /v1/products/:id/sales

Retrieve sales history for a product. Requires read permission.

curl "https://api.luska.ai/v1/products/PRODUCT_ID/sales?limit=12" \
  -H "x-api-key: YOUR_API_KEY"

# Response
{
  "product_id": "uuid",
  "product_name": "Widget Pro",
  "sales": [
    {
      "id": "uuid",
      "period_start": "2025-01-01",
      "period_end": "2025-01-31",
      "units_sold": 150,
      "price_at_time": 29.99,
      "revenue": 4498.50,
      "source": "api"
    }
  ],
  "count": 1
}

Request Body Fields

period_start

required
— Start of the sales period (ISO date)

units_sold

required
— Number of units sold (≥ 0)

period_end — End of the sales period (defaults to end of month)

price_at_time — Selling price during this period (defaults to current product price)

revenue — Total revenue (auto-calculated as units × price if omitted)

Webhooks

Receive real-time notifications when events happen in your Luska account. Configure webhook endpoints in Settings → Webhooks.

Supported Events

price_updated

Fired when a product price is changed manually, via recommendation, dynamic pricing, or Shopify sync.

recommendation_generated

Fired when the AI engine generates a new pricing recommendation for a product.

price_alert

Fired when a competitor price change exceeds your alert threshold.

test

A test event you can trigger from Settings to verify your endpoint.

Payload Format

Example: price_updated event

POST https://your-endpoint.com/webhook
Content-Type: application/json
X-Webhook-Signature: <hmac-sha256-hex>
X-Webhook-Event: price_updated
X-Webhook-Timestamp: 2025-01-15T10:30:00.000Z
X-Webhook-Attempt: 1

{
  "event": "price_updated",
  "timestamp": "2025-01-15T10:30:00.000Z",
  "data": {
    "product_id": "uuid",
    "product_name": "My Product",
    "old_price": 29.99,
    "new_price": 24.99,
    "currency": "USD",
    "source": "recommendation",
    "recommendation_id": "uuid",
    "dispatched_at": "2025-01-15T10:30:00.000Z"
  }
}

Signature Verification

Every webhook delivery includes an X-Webhook-Signature header containing an HMAC-SHA256 hex digest of the request body, signed with your webhook secret. Always verify this signature to ensure requests are from Luska.

Verify signature (Node.js)

const crypto = require('crypto');

function verifyWebhook(body, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(body)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// In your handler:
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-webhook-signature'];
  const isValid = verifyWebhook(
    JSON.stringify(req.body),
    signature,
    process.env.LUSKA_WEBHOOK_SECRET
  );
  if (!isValid) return res.status(401).send('Invalid signature');
  
  // Process the event
  console.log('Event:', req.body.event);
  res.status(200).send('OK');
});

Retry Policy

  • Retries:Up to 3 retries with exponential backoff (1s → 2s → 4s, with ±25% jitter)
  • Timeout:10 seconds per attempt — ensure your endpoint responds quickly
  • Retryable:5xx errors and 429 (rate limit) are retried; 4xx errors are not
  • Auto-disable:After 10 consecutive delivery failures, the webhook is automatically disabled
  • Attempt header:X-Webhook-Attempt indicates the current attempt number

Ready to get started?

API and webhook access is available on Pro and Enterprise plans.