Facebook Marketplace Scraper
Create and run a Facebook Marketplace scraper
API Reference
Endpoint Examples
- Account Summary
- Results
- Scrapers
- Scraping Runs
- AI Scraper
- X (Twitter) Scraper
- Google Scraper
- Job Board Scraper
- Facebook Marketplace Scraper
- PDF Scraper
- Realestate.com.au Scraper
- Shopee Scraper
Facebook Marketplace Scraper
Create and run a Facebook Marketplace scraper
This endpoint allows you to create and run a Facebook Marketplace scraper to scrape the listings available in Facebook Marketplace.
POST
/
api
/
scrapers
/
fb-marketplace
/
create-and-run
curl --request POST \
--url https://app.mrscraper.com/api/scrapers/fb-marketplace/create-and-run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Test Latest",
"webhook_url": "https://example.com",
"pagination": 5,
"detail": false,
"zip_codes": [
"80004",
"14350",
"80301"
],
"categories": [
{
"name": "Air Conditioners",
"url": "https://www.facebook.com/marketplace/category/air-conditioners/"
},
{
"name": "Cars",
"url": "https://www.facebook.com/marketplace/category/cars/"
},
{
"name": "Electronics",
"url": "https://www.facebook.com/marketplace/category/electronics/"
}
]
}'
{
"message": "Scraping queued successfully",
"scraper": {
"id": 387,
"name": "Facebook Marketplace",
"url": [
"https://www.facebook.com/marketplace"
],
"urls": [
"https://www.facebook.com/marketplace"
],
"scheduled": false,
"schedule": null,
"created_at": "2024-09-20T06:50:16.000000Z",
"updated_at": "2024-09-20T06:50:16.000000Z"
},
"results": [
{
"scraping_run_id": 1026,
"user_id": 26,
"scraper_name": "Test Latest",
"scrapped_url": "80004\n14350\n80301",
"scraped_url": "80004\n14350\n80301",
"scraper_id": 387,
"status": "running",
"updated_at": "2024-09-20T06:50:17.000000Z",
"created_at": "2024-09-20T06:50:16.000000Z",
"id": 1291,
"scraper": {
"id": 387,
"user_id": 26,
"sharing": false,
"share_uuid": null,
"name": "Test Latest",
"type": "fb_marketplace",
"urls": "https://www.facebook.com/marketplace",
"pdf_urls": "Default",
"ai_prompt": null,
"ai_scope": null,
"headers": null,
"cookies": null,
"user_agent": null,
"disabled_resources": null,
"delay": 0,
"html_wanted": false,
"screenshot_wanted": false,
"screenshot_type": null,
"locale": null,
"scheduled": false,
"cron": null,
"cron_timezone": "UTC",
"paginate": 0,
"pagination_type": null,
"infinite_pagination_type": null,
"infinite_pagination_seconds": null,
"infinite_pagination_text": null,
"infinite_pagination_css_selector": null,
"infinite_pagination_n_selector": null,
"load_more_selector": null,
"pagination_query_parameter": null,
"pagination_next_page_selector": null,
"pagination_limit_type": null,
"pagination_max_page": null,
"max_next_page": null,
"pagination_max_variable": null,
"created_at": "2024-09-20T06:50:16.000000Z",
"updated_at": "2024-09-20T06:50:16.000000Z",
"cron_minutes": "*",
"cron_minutes_n_detail": null,
"cron_minutes_x_detail": null,
"cron_hours": "*",
"cron_hours_n_detail": null,
"cron_hours_x_detail": null,
"cron_day_of_month": "*",
"cron_day_of_month_x_detail": null,
"cron_month": "*",
"cron_month_x_detail": null,
"cron_day_of_week": "*",
"cron_day_of_week_x_detail": null,
"click_action_enabled": false,
"click_action_selector": null,
"click_action_wait": "no",
"workflow": [
{
"type": "options",
"data": {
"webhook_url": "https://vnctkevin.com",
"zip_codes": "80004\n14350\n80301",
"categories": [
{
"type": "category",
"data": {
"name": "Air Conditioners",
"url": "https://www.facebook.com/marketplace/category/air-conditioners/"
}
},
{
"type": "category",
"data": {
"name": "Cars",
"url": "https://www.facebook.com/marketplace/category/cars/"
}
},
{
"type": "category",
"data": {
"name": "Electronics",
"url": "https://www.facebook.com/marketplace/category/electronics/"
}
}
]
}
}
],
"version": 2,
"proxy_type": "rotation",
"proxy_host": null,
"proxy_port": null,
"proxy_username": null,
"proxy_password": null,
"parsers": null,
"deleted_at": null
}
}
]
}
Authorizations
You can retrieve your token by visiting the API Tokens section inside your profile page or see https://docs.mrscraper.com/documentation/api-token for the details.
Body
application/json
The name of the scraping task.
The zip codes to scrape.
The URL to which the scraping results will be sent using POST request.
Scrape until page.
Scrape listed date.
curl --request POST \
--url https://app.mrscraper.com/api/scrapers/fb-marketplace/create-and-run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Test Latest",
"webhook_url": "https://example.com",
"pagination": 5,
"detail": false,
"zip_codes": [
"80004",
"14350",
"80301"
],
"categories": [
{
"name": "Air Conditioners",
"url": "https://www.facebook.com/marketplace/category/air-conditioners/"
},
{
"name": "Cars",
"url": "https://www.facebook.com/marketplace/category/cars/"
},
{
"name": "Electronics",
"url": "https://www.facebook.com/marketplace/category/electronics/"
}
]
}'
{
"message": "Scraping queued successfully",
"scraper": {
"id": 387,
"name": "Facebook Marketplace",
"url": [
"https://www.facebook.com/marketplace"
],
"urls": [
"https://www.facebook.com/marketplace"
],
"scheduled": false,
"schedule": null,
"created_at": "2024-09-20T06:50:16.000000Z",
"updated_at": "2024-09-20T06:50:16.000000Z"
},
"results": [
{
"scraping_run_id": 1026,
"user_id": 26,
"scraper_name": "Test Latest",
"scrapped_url": "80004\n14350\n80301",
"scraped_url": "80004\n14350\n80301",
"scraper_id": 387,
"status": "running",
"updated_at": "2024-09-20T06:50:17.000000Z",
"created_at": "2024-09-20T06:50:16.000000Z",
"id": 1291,
"scraper": {
"id": 387,
"user_id": 26,
"sharing": false,
"share_uuid": null,
"name": "Test Latest",
"type": "fb_marketplace",
"urls": "https://www.facebook.com/marketplace",
"pdf_urls": "Default",
"ai_prompt": null,
"ai_scope": null,
"headers": null,
"cookies": null,
"user_agent": null,
"disabled_resources": null,
"delay": 0,
"html_wanted": false,
"screenshot_wanted": false,
"screenshot_type": null,
"locale": null,
"scheduled": false,
"cron": null,
"cron_timezone": "UTC",
"paginate": 0,
"pagination_type": null,
"infinite_pagination_type": null,
"infinite_pagination_seconds": null,
"infinite_pagination_text": null,
"infinite_pagination_css_selector": null,
"infinite_pagination_n_selector": null,
"load_more_selector": null,
"pagination_query_parameter": null,
"pagination_next_page_selector": null,
"pagination_limit_type": null,
"pagination_max_page": null,
"max_next_page": null,
"pagination_max_variable": null,
"created_at": "2024-09-20T06:50:16.000000Z",
"updated_at": "2024-09-20T06:50:16.000000Z",
"cron_minutes": "*",
"cron_minutes_n_detail": null,
"cron_minutes_x_detail": null,
"cron_hours": "*",
"cron_hours_n_detail": null,
"cron_hours_x_detail": null,
"cron_day_of_month": "*",
"cron_day_of_month_x_detail": null,
"cron_month": "*",
"cron_month_x_detail": null,
"cron_day_of_week": "*",
"cron_day_of_week_x_detail": null,
"click_action_enabled": false,
"click_action_selector": null,
"click_action_wait": "no",
"workflow": [
{
"type": "options",
"data": {
"webhook_url": "https://vnctkevin.com",
"zip_codes": "80004\n14350\n80301",
"categories": [
{
"type": "category",
"data": {
"name": "Air Conditioners",
"url": "https://www.facebook.com/marketplace/category/air-conditioners/"
}
},
{
"type": "category",
"data": {
"name": "Cars",
"url": "https://www.facebook.com/marketplace/category/cars/"
}
},
{
"type": "category",
"data": {
"name": "Electronics",
"url": "https://www.facebook.com/marketplace/category/electronics/"
}
}
]
}
}
],
"version": 2,
"proxy_type": "rotation",
"proxy_host": null,
"proxy_port": null,
"proxy_username": null,
"proxy_password": null,
"parsers": null,
"deleted_at": null
}
}
]
}