100 free credits — no credit card required.Start building
Logo
Developer tutorial

How to scrape Facebook Marketplace listings with Python (2026)

This tutorial shows how to scrape Facebook Marketplace listings in Python using the SocialCrawl API. You get listings matching a query near a latitude/longitude, each with title, price, location, and image from one GET request, with no Facebook developer account, proxies, or HTML parsing. The code below is runnable as-is, and the response underneath it is a real, unedited call.

How it works

  1. 1
    Get a free API keyCreate a SocialCrawl account and copy your API key from the dashboard. Every new account starts with free credits.
  2. 2
    Set up PythonInstall the requests library with `pip install requests`.
  3. 3
    Call the Facebook Marketplace Search endpointSend a GET request to /v1/facebook/marketplace/search with your API key in the x-api-key header and the `query` and `lat` and `lng` parameters.
  4. 4
    Read the responseParse the JSON. SocialCrawl returns listings matching a query near a latitude/longitude, each with title, price, location, and image in one normalized schema, so you write no HTML parsing or proxy code.

The code

A real, unedited response from the request above.

import requests

response = requests.get(
    "https://www.socialcrawl.dev/v1/facebook/marketplace/search",
    headers={"x-api-key": "YOUR_API_KEY"},
    params={"query": "bike", "lat": "40.7128", "lng": "-74.0060"},
)
data = response.json()
print(data)
[ RESPONSE ]
{
  "success": true,
  "platform": "facebook",
  "endpoint": "/v1/facebook/marketplace/search",
  "data": {
    "items": [
      {
        "id": "1066419019364958",
        "url": "https://www.facebook.com/marketplace/item/1066419019364958/",
        "title": "Bike",
        "creation_time": null,
        "listing_date_text": null,
        "mileage": null,
        "custom_subtitles": [],
        "price": {
          "formatted_amount": "$25",
          "amount_with_offset_in_currency": 2500,
          "amount": 25
        },
        "strikethrough_price": null,
        "location": {
          "city": "Astoria",
          "state": "NY",
          "display_name": "New York, New York",
          "city_page_id": "108424279189115"
        },
        "primary_photo": {
          "id": "1002631985728320",
          "url": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.84726-6/748873705_1002631995728319_5751954950561506666_n.jpg?stp=c43.0.260.260a_dst-jpg_p261x260_tt6&_nc_cat=110&ccb=1-7&_nc_sid=92e707&_nc_ohc=58Revh-HDIwQ7kNvwGwSXkk&_nc_oc=Adrcg45dhaKHxKwjTJejdQZtfEoSBHmY0urksdhLBNbP4Phv8uOQoGTNTihDl35Gm8M&_nc_zt=14&_nc_ht=scontent-bos5-1.xx&_nc_gid=gQ-nBD6KvcLRzJIhWERFbA&_nc_ss=7f289&oh=00_AQDzC_QM5CWzt-LisJMijVQ3EKreXM-Mjcsnsu9_PJCq9w&oe=6A6346AA"
        },
        "category_id": "1658310421102081",
        "is_hidden": false,
        "is_live": true,
        "is_pending": false,
        "is_sold": false,
        "is_viewer_seller": false,
        "delivery_types": [
          "IN_PERSON"
        ],
        "story_type": "POST",
        "story_key": "27171976579169356"
      },
      {
        "id": "1765137338175571",
        "url": "https://www.facebook.com/marketplace/item/1765137338175571/",
        "title": "Bike",
        "creation_time": null,
        "listing_date_text": null,
        "mileage": null,
        "custom_subtitles": [],
        "price": {
          "formatted_amount": "$40",
          "amount_with_offset_in_currency": 4000,
          "amount": 40
        },
        "strikethrough_price": null,
        "location": {
          "city": "Staten Island",
          "state": "NY",
          "display_name": "New York, New York",
          "city_page_id": "108424279189115"
        },
        "primary_photo": {
          "id": "1073569065000075",
          "url": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.84726-6/731525408_1073569071666741_9095896043048172097_n.jpg?stp=c0.43.261.261a_dst-jpg_p261x260_tt6&_nc_cat=103&ccb=1-7&_nc_sid=92e707&_nc_ohc=WwuEfmFb4YgQ7kNvwHQtXC1&_nc_oc=AdqSLugqkiTyMKL8k7Oo5XIp7A7mcZK5hSGviA1Us93YIEHF6672q6MKUdUjkELyMc4&_nc_zt=14&_nc_ht=scontent-bos5-1.xx&_nc_gid=gQ-nBD6KvcLRzJIhWERFbA&_nc_ss=7f289&oh=00_AQBk8EkghCcELj9asbbv02WyjRH9Y-7YsvGXt88A7ftx6Q&oe=6A632562"
        },
        "category_id": "1658310421102081",
        "is_hidden": false,
        "is_live": true,
        "is_pending": false,
        "is_sold": false,
        "is_viewer_seller": false,
        "delivery_types": [
          "IN_PERSON"
        ],
        "story_type": "POST",
        "story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YnAiOm51bGwsIm5jcm5kIjowLCJpcnNyIjpmYWxzZSwiYm1wciI6W10sImJtcGVpZCI6W10sIm5tYm1wIjpmYWxzZSwic2tyciI6ZmFsc2UsImlvb3VyIjpmYWxzZSwiaXNlIjpmYWxzZSwic21zX2N1cnNvciI6eyJwYWdlX2luZGV4IjowLCJibGVuZGVkX2FkX2luZGV4IjowLCJvcmdhbmljc19zaW5jZV9sYXN0X2FkIjowLCJwYWdlX29yZ2FuaWNfY291bnQiOjAsImJsZW5kZWRfb3JnYW5pY19pbmRleCI6MCwicmV0dXJuZWRfYWRfaW5kZXgiOjAsInRvdGFsX2luZGV4IjowfX0",
    "dropped": 0
  },
  "credits_used": 1,
  "credits_remaining": 9999,
  "request_id": "req_example000000",
  "cached": false,
  "pagination": {
    "next_cursor": "sc.eyJ2IjoyLCJjIjoiZXlKd1p5STZNQ3dpWWpKaklqcDdJbUp5SWpvaUlpd2lhWFFpT2pBc0ltaHRjM0lpT21aaGJITmxMQ0owWW1raU9qQjlMQ0pqTW1NaU9uc2lZbklpT2lKQlluQkRPSE41UzIxcU16TlpTVEpTZG1WMlFtRm5jQzB3UVdoUVdGaFNabVpZUVZvMmNVUm9WRTlyY1RCamFIaGtSMkpZU1ZKWFJHSnZjMnBxZWtSdmVXVkxjVTV4TVc5aWNFcElZV05CUVdGMU4wNXhMVmQ2TUZkdmFrNUVVbEZCTlV4TmIyMHhRbFo1UmpGMWFIbFRlamRmYmpOalZsaGlZVkJ6VGxwSVRHcEpUbk4xVkdKd1UwZDRSVWwxWDFoWVFWOXNPVkJPYVRkeE1ERm1TWFl3WTJ4bFUzZE5abUpEWDBrM0xVeElaMlZHWVhSNllVdFpNblJGVlZrMWQyTjFPSGQ0U2pKWlZVMDVRekkxWTJkQ2FWUk1VVEJtV0ZSQlRXd3RkM2hPZUUxSWVuWlJXREpuTFRoSVUzRTFjVlJ4TWtVNFpVcEVSV0k0Y2xJeE5tNUVlSEJpUTFCR1ZWOWlkR1IwUXpCSWJs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TENKdmNtZGhibWxqYzE5emFXNWpaVjlzWVhOMFgyRmtJam93TENKd1lXZGxYMjl5WjJGdWFXTmZZMjkxYm5RaU9qQXNJbUpzWlc1a1pXUmZiM0puWVc1cFkxOXBibVJsZUNJNk1Dd2ljbVYwZFhKdVpXUmZZV1JmYVc1a1pYZ2lPakFzSW5SdmRHRnNYMmx1WkdWNElqb3dmWDAiLCJwIjoiY3Vyc29yIn0",
    "has_more": true,
    "page_size": 14
  }
}
API reference for this endpoint

Prefer another language?

FAQ

Have a question? We got answers

Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.

Contact us
Do I need a Facebook developer account to scrape Facebook Marketplace listings?
No. SocialCrawl handles authentication and proxies upstream, so you never register a Facebook app, manage OAuth tokens, or run your own scrapers. One API key returns Facebook data directly.
What does the Facebook Marketplace Search endpoint return?
It returns listings matching a query near a latitude/longitude, each with title, price, location, and image. The response is normalized into SocialCrawl's unified schema, identical in shape across every platform.
How much does it cost to scrape Facebook Marketplace listings?
Each call costs a small number of credits, and new accounts start with free credits. There are no monthly minimums, so you pay only for the calls you make.
Can I use this Python code in production?
Yes. The snippet on this page is the real request against the live API. For production, add error handling and follow the response cursor to paginate through large result sets.

Ask AI about SocialCrawl