Integration Guide

Integration Guide

Developer documentation for custom integrations and advanced usage

Integrate XBO Market Kit widgets directly into your WordPress theme templates.

Add widgets to any theme template file:

<?php
// In your theme's template file (header.php, sidebar.php, etc.)
echo do_shortcode('
BTC
BTC
BTC/USDT
--
0.00%
ETH
ETH
ETH/USDT
--
0.00%
'); ?>
<?php
// Show ticker only on homepage
if ( is_front_page() ) {
    echo do_shortcode('
BTC
BTC
BTC/USDT
--
0.00%
ETH
ETH
ETH/USDT
--
0.00%
SOL
SOL
SOL/USDT
--
0.00%
'); } // Show movers on blog pages if ( is_home() || is_archive() ) { echo do_shortcode('
PairPrice24h Change
'); } ?>
<?php
/**
 * Template Part: Crypto Ticker Bar
 * File: template-parts/crypto-ticker.php
 */
?>
<div class="crypto-ticker-bar">
    <?php echo do_shortcode('
BTC
BTC
BTC/USDT
--
0.00%
ETH
ETH
ETH/USDT
--
0.00%
BNB
BNB
BNB/USDT
--
0.00%
XRP
XRP
XRP/USDT
--
0.00%
'); ?> </div>

Override default styles to match your site’s design.

All widgets use the .xbo-mk- prefix for CSS classes:

/* Ticker Widget */
.xbo-mk-ticker { }
.xbo-mk-ticker-card { }
.xbo-mk-ticker-symbol { }
.xbo-mk-ticker-price { }
.xbo-mk-ticker-change { }
.xbo-mk-ticker-change--positive { color: #49B47A; }
.xbo-mk-ticker-change--negative { color: #FD3B5E; }

/* Top Movers Widget */
.xbo-mk-movers { }
.xbo-mk-movers-list { }
.xbo-mk-movers-item { }

/* Order Book Widget */
.xbo-mk-orderbook { }
.xbo-mk-orderbook-bids { }
.xbo-mk-orderbook-asks { }

/* Recent Trades Widget */
.xbo-mk-trades { }
.xbo-mk-trades-list { }
.xbo-mk-trades-item { }

/* Slippage Calculator */
.xbo-mk-slippage { }
.xbo-mk-slippage-form { }
.xbo-mk-slippage-result { }

Add to your theme’s style.css or Customizer:

/* Dark theme override */
.xbo-mk-ticker {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
}

.xbo-mk-ticker-card {
    background: #16213e;
    border: 1px solid #0f3460;
}

.xbo-mk-ticker-symbol {
    color: #e94560;
    font-weight: 700;
}

.xbo-mk-ticker-price {
    color: #ffffff;
    font-size: 24px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .xbo-mk-ticker {
        padding: 10px;
    }
    .xbo-mk-ticker-card {
        margin-bottom: 10px;
    }
}

Access market data programmatically via WordPress REST API.

EndpointMethodDescription
/wp-json/xbo/v1/tickerGETGet ticker data for symbols
/wp-json/xbo/v1/moversGETGet top gainers/losers
/wp-json/xbo/v1/orderbookGETGet order book depth
/wp-json/xbo/v1/tradesGETGet recent trades
/wp-json/xbo/v1/slippageGETCalculate slippage
// Fetch ticker data
fetch('/wp-json/xbo/v1/ticker?symbols=BTC/USDT,ETH/USDT')
    .then(response => response.json())
    .then(data => {
        console.log(data);
        // Process ticker data
    })
    .catch(error => console.error('Error:', error));

// Fetch top movers
fetch('/wp-json/xbo/v1/movers?count=10')
    .then(response => response.json())
    .then(data => {
        // Display movers data
    });
<?php
// Get ticker data programmatically
$response = wp_remote_get(
    home_url('/wp-json/xbo/v1/ticker?symbols=BTC/USDT,ETH/USDT')
);

if ( ! is_wp_error( $response ) ) {
    $data = json_decode( wp_remote_retrieve_body( $response ), true );

    foreach ( $data as $ticker ) {
        echo '<div>';
        echo '<strong>' . esc_html( $ticker['symbol'] ) . '</strong>: ';
        echo esc_html( $ticker['price'] );
        echo '</div>';
    }
}
?>

Complete shortcode documentation with all available attributes.

BTC
BTC
BTC/USDT
--
0.00%
ETH
ETH
ETH/USDT
--
0.00%
SOL
SOL
SOL/USDT
--
0.00%

Attributes:

  • symbols – Trading pairs (comma-separated)
  • columns – Grid columns (1-6, default: 4)
  • refresh – Auto-refresh seconds (15, 30, 60)
  • showSparkline – Show trend chart (true/false)
PairPrice24h Change

Order Book — BTC/USDT

PriceAmount
PriceAmount
Spread: --

Recent Trades — BTC/USDT

TimeSidePriceAmount

Slippage Calculator

  • No results
/
  • No results
Avg Price
—
Slippage
—
Spread
—
Spread %
—
Depth Used
—
Total Cost
—
Calculating...