Any tips/tricks for scrapping facebook marketplace?

buddy732

Newbie
Joined
Jun 30, 2025
Messages
14
Reaction score
6
Hi,

I'm aware that Facebook is the final boss of web scraping, but I'm hitting a brick wall here. I’ve figured out how to scrape the initial listings and capture the GraphQL requests/responses automatically generated by Facebook (playwright). What I’m trying to do is make it more efficient by crafting/replaying those GraphQL requests myself without having to load the page or scroll. But no matter how I craft the request, it always gets rejected.

Any tips or pointers from someone who has successfully done this? I’m also aware of using proxies and rotating Facebook accounts to help with this; I’m just having issues crafting my own POST requests with the right headers and payloads. I don’t expect people to share their entire workflow just point me in the right direction.

Thanks
 
Yeah, Facebook GraphQL is a pain to mess with. Capturing the requests in Playwright is a good start, but replaying them raw usually doesn’t work unless you’re copying the whole context, headers, tokens, dynamic params, sometimes even weird stuff like scroll position.

What’s worked better for me is recording the full session and replaying it in the same browser context. Trying to separate it out completely? Then yeah, you’ll probably need to spoof the fb_dtsg tokens and signature logic exactly like it comes through in real-time.

Also, double check your payload, Facebook’s picky, and even switching the field order can get it rejected. You’re going in the right direction, but yeah, their bot detection is no joke. Everything has to line up almost perfectly.
 
To collect data from Facebook Marketplace safely and within guidelines, follow these tips:
  1. Manual scraping with filters: Use Facebook's built-in search and filters to narrow listings, then manually collect key data.
  2. Use browser automation tools (e.g. Puppeteer, Selenium) for personal use only — throttle requests, mimic human behavior.
  3. Logged-in session only: Marketplace requires login. Use your own account with stable IP.
  4. No API available: Facebook doesn’t offer official Marketplace API — avoid third-party tools claiming full access.
  5. Respect Facebook’s terms: Don’t mass scrape, resell data, or use it for unsolicited outreach.
✅ For research or personal data gathering, go slow and keep it human-like.
 
Crafting GraphQL requests for Facebook Marketplace is tricky! :suspicious: Mimic exact browser headers (like Authorization, X-FB-*) and query hashes from inspected requests :cool:
Use residential proxies and test small batches to avoid bans!
 
Yeah, Facebook GraphQL is a pain to mess with. Capturing the requests in Playwright is a good start, but replaying them raw usually doesn’t work unless you’re copying the whole context, headers, tokens, dynamic params, sometimes even weird stuff like scroll position.

What’s worked better for me is recording the full session and replaying it in the same browser context. Trying to separate it out completely? Then yeah, you’ll probably need to spoof the fb_dtsg tokens and signature logic exactly like it comes through in real-time.

Also, double check your payload, Facebook’s picky, and even switching the field order can get it rejected. You’re going in the right direction, but yeah, their bot detection is no joke. Everything has to line up almost perfectly.
Gotcha thanks for the response! I'm building an app where I want to show the users listings from marketplace similar to what this app does

Freebie Alerts: Free Stuff App​

https://play.google.com/store/apps/details?id=com.rodolfogs.nextdooralerts&hl=en_US

Somehow they are able to get the free listings given a zip code almost instantly, how they do it no idea that's what I'm trying to figure out. I sniffed the apps traffic and once the search hits their backend the listings come back damn near instantly and its not cached the the listings are pretty fresh. Works for obscure zip codes to.

I'll keep poking if I cant figure it out ill stay with my approach even its slower.
 
Hi,

I'm aware that Facebook is the final boss of web scraping, but I'm hitting a brick wall here. I’ve figured out how to scrape the initial listings and capture the GraphQL requests/responses automatically generated by Facebook (playwright). What I’m trying to do is make it more efficient by crafting/replaying those GraphQL requests myself without having to load the page or scroll. But no matter how I craft the request, it always gets rejected.

Any tips or pointers from someone who has successfully done this? I’m also aware of using proxies and rotating Facebook accounts to help with this; I’m just having issues crafting my own POST requests with the right headers and payloads. I don’t expect people to share their entire workflow just point me in the right direction.

Thanks
Facebook GraphQL is tricky. While capturing requests with Playwright helps, replaying them often fails without the full context—headers, tokens, and dynamic parameters.
Recording the full session and replaying it in the same browser context works better. If you separate things, you’ll need to spoof fb_dtsg tokens accurately.
Also, double-check your payload; minor changes can lead to rejections. Their bot detection is tough—everything must align perfectly.
 
Crafting GraphQL requests manually is tricky, you have to include the correct headers, tokens, and query variables. Use Playwright to capture and replay real requests in a valid session to avoid rejection.
 
You're on the right track—replaying GraphQL requests is tricky because Facebook validates more than just headers (like request integrity and session context). Make sure you're including valid fb_dtsg, user agent, and consistent cookies from an active session. Emulating actual browser behavior with a headless browser or using browser automation tools like Puppeteer often works better than raw POST attempts.
 
Facebook’s GraphQL layer is tightly guarded, especially against non-browser-originated calls.
1. Headers & fingerprint context matter a lot
2. Tokens rotate rapidly
3. Rebuilding tokens via browser context
4. Use session memory instead of raw cookies. We never got full consistency without using realistic human patterns and session-coupled token rotation, but if you're close to capturing valid GraphQL responses, you're 90% there.
 
Straight up, Facebook’s GraphQL requests are heavily monitored by advanced systems, so creating your own requests without being blocked is extremely challenging.

Some tips to help you move in the right direction:​

  1. Optimize headers and cookies:
    – Make sure your headers, cookies, CSRF tokens, and auth parameters exactly match the real captured requests. Facebook checks these meticulously.
  2. Use residential proxies & rotate user-agents:
    – Use residential IPs (real-user proxies), avoid datacenter IPs which are easily blocked.
    – Rotate user-agent strings to mimic real browsers and common versions.
  3. Have real user interactions beforehand:
    – Your Facebook accounts should have normal interactions to avoid bot suspicion before making requests.
  4. Respect rate limits and add delays:
    – Don’t spam requests continuously; space them out to mimic real user behavior.
  5. Craft POST payloads carefully:
    – POST data must be properly formatted JSON, with all required parameters—no extras or missing fields.
    – Analyze the real payloads carefully and replicate all important fields.

In short:​

To succeed, you must mirror the real requests in every detail, use residential proxies, and “warm-up” your accounts well. Facebook is extremely sensitive to fake or suspicious requests.
If you want, I can help you check your payload and headers to optimize them.
 
Replay the exact real request from the web, keeping all headers and fb_dtsg, cookie intact. Don’t change the payload too much. Running it in a real browser context makes it much easier to get through.
 
Things That Might Work:

1. Don't send the POST from requests or httpx.
Use page.evaluate or page.request.post(...) inside the actual Playwright browser context. This keeps the headers, cookies, TLS, and fingerprinting intact.
Craft the request manually but execute it from inside the browser session, you'll often get better results.

2. Tools like browser DevTools Protocol (or playwright-har) let you export full request headers/cookies exactly.

Replay them exactly (header order, values, user-agent).
But beware, they still expire fast. fb_dtsg especially.

Those are just some ideas..
 
To successfully resend a GraphQL Facebook request, you need to use the correct token, cookies, headers, and payload from the real browser session instead of creating them manually.
 
To successfully resubmit a GraphQL request to Facebook, you must copy the exact token, cookie, headers, and payload from the real session.
 
The lack of an official Marketplace API makes things difficult, and relying on third-party tools can lead to issues. As for Facebook GraphQL, it’s a pain to work with, but capturing requests with Playwright and replaying them in the correct context definitely helps. It’s all about ensuring headers, tokens, and dynamic parameters are handled properly.
 
If you're talking about removing or disabling the Facebook Marketplace feature on a personal account or fan page, let's be clear: Facebook doesn't allow users to completely disable Marketplace if their account is eligible to use it.
 
Back
Top