Navigation
🚨

Critical Security Migration

The luigisbox.com domain is compromised. Immediate action is required.

1. Update API Base URLs

Replace the base URL for all API requests (Search, Recommendations, Analytics):

https://live.luigisbox.com
➡️ https://live.luigisbox.tech

2. Replace Frontend Script

The .com script is no longer safe. Replace it with the secure version immediately:

[OLD - Delete from site]
<script async src="https://scripts.luigisbox.com/LBX-123.js"></script>
[NEW - Secure Version]
<script async src="https://scripts.luigisbox.tech/LBX-123.js"></script>

3. Update CSP & Firewalls

If you use a Content Security Policy, whitelist the new domain to prevent the browser from blocking the connection.

script-src https://scripts.luigisbox.tech;
connect-src https://live.luigisbox.tech;
⚠️
Emergency Action: If you cannot update the code right now, remove the existing Luigi's Box script until the migration is complete to prevent unauthorized code execution.

Support: support@luigisbox.net MODIFIED: 12/17/2025

Top Items API V1

Legacy endpoint for retrieving popular items.

Get top items

Retrieve most popular items of any type.

GET https://live.luigisbox.com/v1/top_items

Request Parameters

Required parameters

Parameter Type Required Description
tracker_id string Your site identifier.
type string Object types and counts (e.g., item:10).

Optional parameters

Parameter Type Description
f_type[] string Filter results.
hit_fields string Fields to retrieve.
ctx[] string Context parameters.

Request Headers

Consider sending request header of Accept-Encoding as well with values for supported encoding methods of your HTTP client, e.g. gzip or br, gzip, deflate for multiple supported methods. Encodings make the response from the JSON API considerably smaller and thus faster to transfer.

Example Request

curl "https://live.luigisbox.com/v1/top_items?tracker_id=YOUR_TRACKER_ID&type=item:10" \
     -H "Accept-Encoding: gzip, deflate"

How to make a request

The following examples demonstrate how to send a request to the Top Items API V1.

To make a valid request:

  1. Endpoint: Use https://live.luigisbox.com/v1/top_items.
  2. Parameters: Provide your tracker_id and the type of items to retrieve (e.g., item:10).

For a complete guide on implementation strategies, see Quickstart: Implementing Top Items Suggestions.

Example Code

# --- Ruby Example for GET /v1/top_items ---
# Assumes 'faraday' gem is installed

require 'faraday' require 'json'

LUIGISBOX_HOST = 'https://live.luigisbox.com' ENDPOINT_PATH = '/v1/top_items' TRACKER_ID = 'your_tracker_id'

connection = Faraday.new(url: LUIGISBOX_HOST) response = connection.get(ENDPOINT_PATH) do |req| req.params['tracker_id'] = TRACKER_ID req.params['type'] = 'item:10' end

puts response.body if response.success?

<?php
// PHP Example for GET /v1/top_items
// Assumes Guzzle is installed

require 'vendor/autoload.php'; use GuzzleHttp\Client;

$LUIGISBOX_HOST = 'https://live.luigisbox.com'; $ENDPOINT_PATH = '/v1/top_items'; $TRACKER_ID = 'your_tracker_id';

$client = new GuzzleHttp\Client(); $response = $client->request('GET', "{$LUIGISBOX_HOST}{$ENDPOINT_PATH}", [ 'query' => ['tracker_id' => $TRACKER_ID, 'type' => 'item:10'] ]);

if($response->getStatusCode() == 200) { echo $response->getBody(); }

const axios = require('axios');

// V1 Top Items Request const LUIGISBOX_HOST = 'https://live.luigisbox.com'; const ENDPOINT_PATH = '/v1/top_items'; const TRACKER_ID = 'your_tracker_id';

axios.get(LUIGISBOX_HOST + ENDPOINT_PATH, { params: { tracker_id: TRACKER_ID, type: 'item:10' } }) .then(response => console.log(response.data)) .catch(error => console.error(error));

Response Structure

Response Attributes

Field Type Description
hits array List of result objects.

Example Response

{
    "hits": [
        {
            "url": "http://www.e-shop.com/products/123456",
            "attributes": {
                "title": "Product X",
                "price": "5.52 EUR"
            },
            "type": "item",
            "exact": true
        }
    ]
}

Get Personalized Top Items

Serves specific recommendations based on user history.

GET https://live.luigisbox.com/v1/personalized_top_items

Request Parameters (Personalized)

Required parameters

Parameter Type Required Description
tracker_id string Your site identifier.
user_id string User ID to personalize for.
type string Object types and counts.

Optional parameters

Parameter Type Description
ctx[] string Context parameters.

Example Request

curl "https://live.luigisbox.com/v1/personalized_top_items?tracker_id=YOUR_TRACKER_ID&user_id=UID&type=item:10" \
     -H "Accept-Encoding: gzip, deflate"

How to make a personalized request

Include the user_id parameter to get personalized results.

Example Code

# --- Ruby Example for GET /v1/personalized_top_items ---
# Assumes 'faraday' gem is installed

require 'faraday' require 'json'

LUIGISBOX_HOST = 'https://live.luigisbox.com' ENDPOINT_PATH = '/v1/personalized_top_items' TRACKER_ID = 'your_tracker_id'

connection = Faraday.new(url: LUIGISBOX_HOST) response = connection.get(ENDPOINT_PATH) do |req| req.params['tracker_id'] = TRACKER_ID req.params['user_id'] = 'UID' req.params['type'] = 'item:10' end

puts response.body if response.success?

<?php
// PHP Example for GET /v1/personalized_top_items
// Assumes Guzzle is installed

require 'vendor/autoload.php'; use GuzzleHttp\Client;

$LUIGISBOX_HOST = 'https://live.luigisbox.com'; $ENDPOINT_PATH = '/v1/personalized_top_items'; $TRACKER_ID = 'your_tracker_id';

$client = new GuzzleHttp\Client(); $response = $client->request('GET', "{$LUIGISBOX_HOST}{$ENDPOINT_PATH}", [ 'query' => ['tracker_id' => $TRACKER_ID, 'user_id' => 'UID', 'type' => 'item:10'] ]);

if($response->getStatusCode() == 200) { echo $response->getBody(); }

const axios = require('axios');

// V1 Personalized Top Items Request const LUIGISBOX_HOST = 'https://live.luigisbox.com'; const ENDPOINT_PATH = '/v1/personalized_top_items'; const TRACKER_ID = 'your_tracker_id';

axios.get(LUIGISBOX_HOST + ENDPOINT_PATH, { params: { tracker_id: TRACKER_ID, user_id: 'UID', type: 'item:10' } }) .then(response => console.log(response.data)) .catch(error => console.error(error));

Error Handling

The API uses standard HTTP status codes to indicate success or failure.

HTTP Status Description
200 OK The request was successful and results are returned.
400 Bad Request The request was malformed (e.g., missing tracker_id).
504 Gateway Timeout The request took too long to process. Retrying might succeed.

Example Error

{
  "type": "malformed_input",
  "reason": "incorrect parameters provided"
}