Facebook Marketplace Scraper
If you work in e-commerce or need product data for market research, you may be interested in scraping public product listings for sale from Facebook Marketplace in your local area, or from anywhere in the world.
We’ll show you how to legally scrape this data using only your web browser and a recording of your web traffic as you browse Facebook Marketplace in full accordance with their Terms of Service.
This means you’ll never have to worry about getting blocked or wasting time with broken screen scrapers.
1. Browse Facebook Marketplace
Head to Facebook Marketplace and enter in any search or jump to a category page. You can also apply any filters that are relevant to your search and jump to any location - simply browse the website normally until you get to the desired data you’d like to scrape. In this example, we’ll be scraping the Cars Category Page.
Once you see the results you want, right click on the page and hit “Inspect” to open up developer tools. This will automatically begin recording your web traffic so you can capture the raw JSON data that Facebook sends to your browser as you navigate through their website.
Now refresh the web page to get Facebook to resend the initial search results to your browser and begin scrolling down through the page. Keep scrolling through the results until you get to the end or feel that you’ve captured enough data.
2. Export a HAR File
Once you’re done scrolling through the Facebook Marketplace Listings, go to the “Network” tab under developer tools and click the down arrow labeled “Export HAR…” to download a HAR file containing all of the raw JSON data that Facebook sent to your browser.
Upload the HAR file to the HAR File Web Scraper and look for the HAR group ending in /api/graphql/
as shown above. You should see relevant fields as well, such as listing
, listing_price
, etc… and click “Parse Group” to combine and parse out the data.
3. Download Facebook Marketplace Data
Once the parse finishes, look for the data › marketplace_search › feed_units › edges
collection (or similar) which will contain the product data in CSV format you can download.
To navigate to any product in the results, look for the node.listing.id
column and substitute that value into this URL format: https://www.facebook.com/marketplace/item/LISTING_ID/
- you can also automatically build these URLs in Excel or Google Sheets. Some other useful columns you’ll see are below:
- Listing Title
- Listing ID
- Image URL
- Price
- City
- State
- Seller ID
- Seller Name
- Special Attributes (e.g. vehicle mileage)
You’ll also see a collection data › marketplace_search › feed_units › edges › node › listing › listing_video
which contains links to videos found in the listings, where each listing may have more than one video.