Skip to main content
RapidDev - Software Development Agency
bubble-tutorial

How to build price comparison in Bubble

Build a price comparison feature in Bubble by fetching prices from multiple sources via the API Connector, displaying them in a sortable comparison table using a Repeating Group, highlighting the best deal, and setting up price drop alerts via backend workflows. This gives your app real comparison shopping functionality without code.

What you'll learn

  • How to fetch prices from multiple sources via API Connector
  • How to display a sortable price comparison table in Bubble
  • How to highlight the best price automatically with conditionals
  • How to set up price drop alert notifications
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner7 min read20-25 minAll Bubble plans (external API access required)March 2026RapidDev Engineering Team
TL;DR

Build a price comparison feature in Bubble by fetching prices from multiple sources via the API Connector, displaying them in a sortable comparison table using a Repeating Group, highlighting the best deal, and setting up price drop alerts via backend workflows. This gives your app real comparison shopping functionality without code.

Overview: Building a Price Comparison Feature in Bubble

This tutorial shows you how to build a price comparison feature in Bubble. You will integrate with external APIs to fetch prices from multiple retailers or sources, display them side-by-side in a comparison table, sort by price, highlight the lowest option, and notify users when prices drop below a threshold. This is ideal for shopping comparison sites, product aggregators, or any app that helps users find the best deal.

Prerequisites

  • A Bubble account with an existing app
  • API Connector plugin installed
  • Access to at least one external pricing API (retailer API, affiliate network, or custom data source)
  • Basic understanding of Bubble workflows and Repeating Groups

Step-by-step guide

1

Create the price comparison data types

Go to the Data tab and create two data types. Product with fields: name (text), description (text), image (image), and category (text). PriceEntry with fields: product (Product), source_name (text, e.g., Amazon, Walmart), price (number), url (text, link to the product on the source), currency (text), and last_updated (date). This structure separates the product identity from its prices across different sources.

Expected result: Product and PriceEntry data types exist with fields for multi-source price tracking.

2

Configure API calls to fetch prices

Go to the Plugins tab and open the API Connector. Create a new API for each price source. For example, create an API called RetailerAPI with a call named GetPrice. Set the method to GET, enter the retailer's API URL with the product identifier as a parameter, and configure authentication (typically API key in header, marked Private). Initialize each call with a test product ID to map the response structure including price, product name, and URL fields.

Pro tip: If the retailer does not have a public API, consider using an affiliate network API like CJ Affiliate or ShareASale that aggregates product data from multiple retailers.

Expected result: API Connector calls are configured and initialized for each price source with response mapping complete.

3

Build the price refresh workflow

Create a backend workflow called refresh_prices with parameter product_id (text). In it: look up the Product by ID, then call each retailer API with the product identifier. For each response, search for an existing PriceEntry (product = this product, source_name = this source). If it exists, update the price and last_updated. If not, create a new PriceEntry. Schedule this workflow to run daily for each product, or trigger it on demand when a user views a product page.

Expected result: Prices from all sources are fetched and stored in PriceEntry records, updated daily or on demand.

4

Display the comparison table

On your product detail page, add a Repeating Group with type PriceEntry and data source: Do a search for PriceEntries where product = Current Page Product, sorted by price ascending. In each cell, display: source_name, price (formatted with currency symbol), last_updated (formatted as a relative date like 2 hours ago), and a Visit Store button that opens the url in a new tab. The lowest price appears at the top since the list is sorted ascending.

Expected result: A comparison table shows all source prices sorted from lowest to highest with links to each retailer.

5

Highlight the best deal with conditionals

Add a conditional to the first cell of the Repeating Group: When Current cell's index is 1, change the background color to light green and add a Best Price badge text element with conditional visibility (only visible when index is 1). For additional context, add a Text element showing the savings: max price minus min price, displayed as Save $X compared to the highest price. Calculate this using the PriceEntry search with sort descending first item's price minus ascending first item's price.

Expected result: The lowest price row is highlighted green with a Best Price badge, and the potential savings amount is displayed.

6

Set up price drop alerts

Create a data type called PriceAlert with fields: user (User), product (Product), target_price (number). Add an Alert Me button on the product page that opens a popup where users enter their target price. Create the PriceAlert on save. In the refresh_prices backend workflow, after updating prices, add a step: Search for PriceAlerts where product = this product and target_price >= the new lowest price. For each match, send an email notification to the user with the current best price and source link. For complex comparison platforms with many data sources, consider working with RapidDev for expert Bubble development.

Expected result: Users can set price targets and receive email notifications when the price drops to or below their threshold.

Complete working example

Workflow summary
1PRICE COMPARISON FEATURE WORKFLOW SUMMARY
2=============================================
3
4DATA TYPES:
5 Product
6 - name (text)
7 - description (text)
8 - image (image)
9 - category (text)
10
11 PriceEntry
12 - product (Product)
13 - source_name (text)
14 - price (number)
15 - url (text)
16 - currency (text)
17 - last_updated (date)
18
19 PriceAlert
20 - user (User)
21 - product (Product)
22 - target_price (number)
23 - is_active (yes/no)
24
25BACKEND WORKFLOW: refresh_prices
26 Parameter: product_id (text)
27 Runs: daily or on-demand
28 Step 1: Look up Product by ID
29 Step 2: Call RetailerA API
30 Step 3: Upsert PriceEntry for RetailerA
31 Search existing update price + last_updated
32 OR create new PriceEntry
33 Step 4: Call RetailerB API
34 Step 5: Upsert PriceEntry for RetailerB
35 Step 6: Find lowest new price
36 Step 7: Search PriceAlerts
37 product = this product
38 target_price >= lowest price
39 is_active = yes
40 Step 8: Send email notifications to matched alerts
41 Step 9: Deactivate triggered alerts
42
43PAGE: product-detail
44 Elements:
45 - Product info (name, image, description)
46 - Repeating Group (type: PriceEntry)
47 Data source: Search for PriceEntries
48 product = Current Page Product
49 Sort: price ascending
50 Cell contents:
51 - Text: source_name
52 - Text: price (formatted $#,##0.00)
53 - Text: last_updated (relative)
54 - Link: Visit Store url (new tab)
55 - Conditionals:
56 Cell index 1 green background + "Best Price" badge
57 - Text: Savings calculation
58 highest price - lowest price
59 - Button: Set Price Alert
60 Opens popup with target price input
61
62WORKFLOW: Set price alert
63 Event: Button Save Alert is clicked
64 Action: Create new PriceAlert
65 user = Current User
66 product = Current Page Product
67 target_price = Input Target Price's value
68 is_active = yes

Common mistakes when building price comparison in Bubble

Why it's a problem: Calling retailer APIs on every page load instead of caching results

How to avoid: Cache prices in PriceEntry records and refresh them on a schedule (daily or hourly) via a backend workflow.

Why it's a problem: Not handling API failures gracefully

How to avoid: Check each API response for errors before creating/updating PriceEntry records. Show the last known price with a stale data indicator if the refresh fails.

Why it's a problem: Displaying prices without the last_updated timestamp

How to avoid: Always show the last_updated date formatted as a relative time (e.g., Updated 3 hours ago) next to each price.

Best practices

  • Cache prices in the database and refresh on a schedule rather than calling APIs on every page view
  • Sort the comparison table by price ascending so the best deal is always first
  • Show the last_updated timestamp so users know how fresh the data is
  • Add a Best Price badge to the lowest-priced option for quick visual identification
  • Include direct links to the retailer product page so users can purchase easily
  • Set up price drop alerts as a user engagement feature that brings people back to your app
  • Handle API failures gracefully by showing cached data with a stale indicator

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I am building a price comparison feature in Bubble.io. I need to fetch prices from multiple retailer APIs, display them in a sortable comparison table, highlight the lowest price, and alert users when prices drop. What data types and workflows do I need?

Bubble Prompt

Build a price comparison feature for my product pages. Create Product and PriceEntry data types, configure API calls to fetch prices from multiple sources, display a sorted comparison table with a Best Price highlight, and add price drop alert notifications.

Frequently asked questions

What if a retailer does not have a public API?

Use affiliate network APIs (CJ, ShareASale, Amazon Associates) that aggregate product data. Alternatively, manually enter prices or let users submit prices they find.

How do I handle different currencies from different sources?

Store prices in a base currency and convert at display time using cached exchange rates. See the multi-currency e-commerce tutorial for the conversion pattern.

Can I sort the comparison table by columns other than price?

Yes. Add a Custom State for the sort field and use conditional data sources on the Repeating Group that change the sort parameter based on the selected column header.

How often should I refresh prices?

It depends on your sources. For retail products, daily is usually sufficient. For airline tickets or hotel prices that change frequently, consider hourly updates.

Can RapidDev help build a comparison platform?

Yes. RapidDev specializes in Bubble development and can help build full comparison platforms with multiple API integrations, automated data collection, and advanced filtering and sorting features.

Will the price alert emails count toward Bubble's email limits?

Yes if you use Bubble's built-in email. For higher volumes, integrate SendGrid or Mailgun via the API Connector for better deliverability and no Bubble email limits.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.