DEV Community

Donny Nguyen
Donny Nguyen

Posted on

Build a Local Deal Finder with the Facebook Marketplace Search API

Why Facebook Marketplace Data Matters

Facebook Marketplace has become one of the largest peer-to-peer selling platforms on the planet. Millions of listings go live every day — furniture, electronics, vehicles, you name it. But there's no official public API for searching those listings.

That's where the Facebook Marketplace Search API comes in. It lets you query Marketplace listings by keyword, giving you structured JSON results you can plug straight into your apps.

What You Can Build

  • Deal alert bots that notify you when items drop below a price threshold
  • Price comparison dashboards across Marketplace, Craigslist, and OfferUp
  • Local inventory trackers for resellers sourcing products
  • Market research tools that analyze listing trends over time

Quick Start: Fetching Listings

Here's a working fetch() example that searches for listings matching a keyword:

const response = await fetch(
  'https://consol-usps-tracking-production.up.railway.app/api/search?query=macbook',
  {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json'
    }
  }
);

const data = await response.json();

data.results.forEach(listing => {
  console.log(`${listing.title} - $${listing.price}`);
  console.log(`Location: ${listing.location}`);
  console.log('---');
});
Enter fullscreen mode Exit fullscreen mode

Swap macbook for any keyword — couch, honda civic, ps5 — and you'll get back structured listing data including titles, prices, locations, and more.

Sample Response

{
  "results": [
    {
      "title": "MacBook Pro 2023 M2 - Like New",
      "price": "899",
      "location": "Austin, TX",
      "url": "https://facebook.com/marketplace/item/..."
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Clean, predictable JSON. No scraping headaches, no browser automation, no CAPTCHAs.

Real-World Use Case: Deal Alert Bot

Combine this API with a cron job and a Slack webhook:

// Run every 30 minutes
const listings = await searchMarketplace('standing desk');
const deals = listings.filter(l => parseInt(l.price) < 100);

if (deals.length > 0) {
  await sendSlackNotification(
    `Found ${deals.length} standing desks under $100!`
  );
}
Enter fullscreen mode Exit fullscreen mode

Five minutes of setup, and you'll never miss a deal again.

Get Started

The API is live on RapidAPI with a free tier so you can test it immediately. Head over to the Facebook Marketplace Search API on RapidAPI, subscribe, grab your API key, and start building.

Whether you're building a side project or a production tool, having structured access to Marketplace data opens up possibilities that manual browsing simply can't match.

Top comments (0)