Skip to content

piotrv1001/carousell-scraper-nodejs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Scrape Carousell Listings in Node.js

This example shows how to scrape Carousell listings using the Carousell Listings Scraper actor on Apify — no browser automation or HTML parsing required. The actor handles all the scraping; this repo shows you how to call it from Node.js, pass search parameters, and work with the results.

Carousell scraper results showing listings with title, price, condition, seller, URL, and scraped timestamp

What this example does

  • Calls the Carousell Listings Scraper actor via the Apify API
  • Passes a search URL and proxy configuration as input
  • Waits for the actor run to complete
  • Fetches results from the run's dataset
  • Prints each listing to the console

Prerequisites

Installation

npm install

Environment setup

Copy .env.example to .env and add your Apify API token:

cp .env.example .env

Then edit .env:

APIFY_TOKEN=your_apify_token_here

Usage

npm start

Code example

import { ApifyClient } from 'apify-client';
import 'dotenv/config';

// Initialize the ApifyClient with your Apify API token
// Set APIFY_TOKEN in your .env file (copy .env.example to get started)
const client = new ApifyClient({
    token: process.env.APIFY_TOKEN,
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.carousell.sg/search/?query=iphone&sort_by=3"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "SG"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/carousell-listings-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

Example output

See sample-output.json for a full example. Each listing returns:

Field Description
listingId Unique Carousell listing ID
url Direct URL to the listing
title Listing title
price Listed price (numeric)
currency Currency code (e.g. SGD)
condition Item condition (e.g. Like new, Well used)
description Seller's description text
seller.username Seller's Carousell username
seller.profileUrl Link to seller's profile
images Array of image URLs
category Listing category
timePosted When the listing was posted
views Number of views
likes Number of likes
scrapedAt Timestamp of when data was scraped

Use cases

  • Price research — track second-hand market prices for electronics, furniture, or fashion across Carousell regions
  • Competitive analysis — monitor competitor listings and pricing strategies in specific categories
  • Deal alerts — build a pipeline that flags listings below a target price threshold
  • Inventory monitoring — track how quickly certain items sell and at what price points
  • Market research — aggregate listing data to understand supply and demand trends for specific product categories

Try the actor on Apify

Open the Carousell Listings Scraper on Apify

Related resources

License

MIT

About

Node.js example showing how to scrape Carousell listings using the Apify actor

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors