DEV Community

Donny Nguyen
Donny Nguyen

Posted on

Craigslist Search API — Free to Use

Search Craigslist Listings Programmatically with This API

Scraping Craigslist manually is tedious. The Craigslist Search API lets you query listings by category and location without touching a browser.

What It Does

This API searches Craigslist across multiple cities and categories. You send a query string and get back structured JSON with listing titles, prices, URLs, and locations. Perfect for building price comparison tools, market analysis dashboards, or automated deal finders.

Getting Started

You'll need a RapidAPI key to authenticate requests. Sign up free here.

The main endpoint is:

GET https://craigslist-search-api-production.up.railway.app/api/search?query=test
Enter fullscreen mode Exit fullscreen mode

Code Example

Here's how to search for used iPhones:

const searchCraigslist = async (searchQuery) => {
  const url = 'https://craigslist-search-api-production.up.railway.app/api/search';

  const options = {
    method: 'GET',
    headers: {
      'X-RapidAPI-Key': 'YOUR_API_KEY_HERE',
      'X-RapidAPI-Host': 'craigslist-search-api-production.up.railway.app'
    }
  };

  try {
    const response = await fetch(`${url}?query=${encodeURIComponent(searchQuery)}`, options);
    const data = await response.json();

    console.log('Results found:', data.length);
    data.slice(0, 5).forEach(listing => {
      console.log(`${listing.title} - $${listing.price}`);
      console.log(`Location: ${listing.location}`);
      console.log(`URL: ${listing.url}\n`);
    });

    return data;
  } catch (error) {
    console.error('Error searching Craigslist:', error);
  }
};

// Usage
searchCraigslist('iphone 14 pro');
Enter fullscreen mode Exit fullscreen mode

Response Format

You'll get JSON like this:

[
  {
    "title": "iPhone 14 Pro Max - Excellent Condition",
    "price": 950,
    "location": "San Francisco, CA",
    "url": "https://sfbay.craigslist.org/...",
    "category": "electronics"
  },
  {
    "title": "iPhone 13 - Mint Condition",
    "price": 650,
    "location": "Oakland, CA",
    "url": "https://sfbay.craigslist.org/..."
  }
]
Enter fullscreen mode Exit fullscreen mode

Real-World Use Cases

  • Price monitoring: Track used electronics prices across regions
  • Rental finder: Build a tool to alert you when apartments matching your criteria appear
  • Marketplace analysis: Aggregate data for demand trends
  • Deal automation: Automatically flag listings under a certain price threshold

Ready to Build?

Get your API key on RapidAPI and start building. The free tier gives you plenty of requests to prototype your idea.

Need help? Check the RapidAPI docs or test the endpoint directly in their sandbox before writing code.

Top comments (0)