1. Home
  2. Plugin, Widgets and Website Settings
  3. Widget Reference
  4. Buying Buddy SDK for PHP - Overview & Setup
  1. Home
  2. Plugin, Widgets and Website Settings
  3. Advanced Widgets
  4. Buying Buddy SDK for PHP - Overview & Setup

Buying Buddy SDK for PHP - Overview & Setup

This article provides an introduction to the Buying Buddy SDK for PHP and guides you through the basic setup process.

What is the Buying Buddy SDK for PHP?

The Buying Buddy SDK for PHP works in conjunction with the Buying Buddy JavaScript plugin to provide additional SEO capabilities for your website. It enables server-side pre-rendering of content, making your listings and property pages indexable by search engines.

Key Benefits:

  • Indexable Listings: Display widgets output HTML with links that search engines can follow
  • SEO-Friendly URLs: Property details pages use clean URLs without query parameters
  • Optimized Meta Data: Automatically generates title tags and meta descriptions with property addresses
  • Server-Side Rendering: Content is available before JavaScript loads, improving SEO

Important Notes

Optional Tool: The SDK is purely optional. It's only required if you want to extend the Buying Buddy JavaScript plugin with SEO benefits.

WordPress Not Supported: The SDK is not supported for WordPress websites. Use the Buying Buddy WordPress Plugin instead.

Data Usage Restriction: You cannot use the SDK to run queries and get data for your own custom designs. This violates MLS IDX rules as data license agreements do not permit this use.

Requirements

Before implementing the SDK, ensure you have:

Technical Requirements

  1. PHP Environment: Your website must run on PHP
  2. cURL Enabled: Must be enabled on your server
  3. Cache Directory: Create a writable "cache" directory for the SDK
  4. Latest Buying Buddy Plugin: Use the current JavaScript plugin version

From Your Buying Buddy Account

  1. API Key: Your Buying Buddy API Key for Programming APIs
    • Location: My Account > Account Settings > Preferences
  2. Account Activation Key: Your website activation key
    • Location: Website & Widgets > Getting Started (see bottom of page)

Prerequisites

  • Complete basic Buying Buddy installation first
  • Follow the detailed installation instructions for your website type at: Widgets > Installation and Setup in your Buying Buddy account
  • Refer to our Installing Buying Buddy guide for general setup

Getting Started

Step 1: Download the SDK

  1. Go to Widgets > Installation and Setup in your Buying Buddy account
  2. Select your website from the dropdown
  3. If your website is set as a PHP environment (e.g., raw PHP, Joomla), scroll down to find the SDK download link
  4. Download the SDK ZIP file

The ZIP file contains:

  • MBB folder with MyBuyingBuddy.php SDK files
  • cache directory for temporary files

Step 2: Upload and Setup

  1. Extract the ZIP file contents
  2. Upload the MBB folder to your website's root directory
  3. Ensure the cache directory has write permissions

Step 3: Modify Your JavaScript Plugin

Critical Change Required: You must modify the seo setting in your Buying Buddy JavaScript plugin.

Change from:

var MBB = { seo : "false", data:{ acid : "[ACTIVATION_KEY]" } };

To:

var MBB = { seo : "true", data:{ acid : "[ACTIVATION_KEY]" } };

Important: Setting seo : "true" causes widget HTML to be injected as code rather than loaded with JavaScript. Once you make this change, you must use the SDK for every widget on your site.

Step 4: Include SDK in Your Pages

Add this PHP code to the top of each page where you use Buying Buddy widgets:

<?php
require 'mbb/MyBuyingBuddy.php';
// Enter your API Key and Account Activation Key
$mbbObj = new MyBuyingBuddy( array(
    "api_key" => "[YOUR_API_KEY]",
    "acid" => "[ACTIVATION_KEY]"
    )
);
?>

Step 5: Update Widget Implementation

When using the SDK, you must modify how widgets are implemented:

For each widget, add:

  1. PHP $widgetParams array
  2. HTML div that includes PHP object to load content
  3. Always include a filter in the div for display widgets

Example - Featured List Widget:

<?php
// Widget parameters
$widgetParams = array( 
    "filter" => "mls_id:ca64+city:DENVER",
    "limit" => 20,
    "order" => "create_dt desc",
    "page" => 1
);
$listObj = $mbbObj->getWidget("MBBv3_FeaturedList", $widgetParams);
?>
<div id="MBBv3_FeaturedList" filter="mls_id:ca64+city:DENVER">
    <?php echo $listObj->html?>
</div>

Next Steps

Once you have the basic SDK setup complete:

  1. Implement SEO Features: See our SEO Implementation Guide for detailed SEO setup
  2. Add Specific Widgets: Reference our Widget Implementation Guide for all widget types
  3. Configure URLs: Set up SEO-friendly URLs and .htaccess rules
Updated on July 7, 2025
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support
Buying Buddy Support