{
  "openapi": "3.1.0",
  "info": {
    "title": "Facebook Marketplace API",
    "version": "1.0.0",
    "description": "A Facebook Marketplace API for public listings: search by words or browse a category around any city or point, with price, condition, age and delivery filters, and read one listing in full with every photo, vehicle details and rental details, as structured JSON with cursor paging, a photo download link, a list of searchable places and a free URL parser. Seller contact details are never returned; seller display names and photos are personal data for many listings."
  },
  "servers": [
    {
      "url": "https://api.fetchlayer.dev/facebook-marketplace"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Every error, on every route. Branch on code and retryable rather than on the text; on a 5xx the text is generic. MCP tool errors carry the same fields in structuredContent, and as a JSON text block.",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in words. For a 400, what to change."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status, repeated in the body."
          },
          "code": {
            "type": "string",
            "description": "The kind of error, stable: invalid_input, unauthorized, insufficient_credits, forbidden, not_found, expired, quota_exceeded, cancelled, time_limit, temporarily_unavailable, posts_unavailable, account_restricted, accounts_unavailable, follow_up_not_sent, store_unreachable, upstream_error, target_error, internal_error, tool_error. A platform may add its own; more may be added. Treat a code you do not recognise by its retryable flag."
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether asking again can succeed."
          },
          "requestId": {
            "type": "string",
            "description": "This request’s id, also sent as the X-Request-Id header. Quote it when reporting a problem."
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With invalid_input when the request's parameters are refused before the request runs: the parameters that were missing. Always present on those errors, empty when nothing was missing."
          }
        },
        "required": [
          "error",
          "code",
          "retryable",
          "requestId"
        ]
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Send your FetchLayer key as Authorization: Bearer ss-your-key."
      }
    }
  },
  "paths": {
    "/search-listings": {
      "post": {
        "operationId": "search-listings",
        "tags": [
          "Listings"
        ],
        "summary": "Search listings",
        "description": "Listings matching words, around a city or a point, with price, condition, age, delivery and category filters, sorted by best match (Facebook’s own ranking, which changes between runs), newest, price or distance. Up to 500 a request, with nextCursor for more. For monitoring, sort by newest. 1 credit per 24 listings returned, minimum 1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Words to search for."
                  },
                  "city": {
                    "type": "string",
                    "description": "Where to search: a place /locations lists (its slug, such as london or nyc) or the city key of a Marketplace URL (facebook.com/marketplace/<city>/). Or give latitude and longitude instead."
                  },
                  "latitude": {
                    "type": "number",
                    "description": "With longitude: search around this point, anywhere Marketplace is available. Both or neither."
                  },
                  "longitude": {
                    "type": "number",
                    "description": "With latitude."
                  },
                  "radiusKm": {
                    "type": "integer",
                    "description": "How far around, 1-500 km. Facebook treats it as a guide, so some listings may lie a little outside it.",
                    "example": "65"
                  },
                  "minPrice": {
                    "type": "integer",
                    "description": "Lowest price, in whole units of the local currency (50 = $50 in the US)."
                  },
                  "maxPrice": {
                    "type": "integer",
                    "description": "Highest price, in whole units of the local currency."
                  },
                  "condition": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Any of new, used_like_new, used_good, used_fair."
                  },
                  "daysSinceListed": {
                    "type": "integer",
                    "description": "Only listings posted in the last 1, 7 or 30 days."
                  },
                  "sortBy": {
                    "type": "string",
                    "description": "best_match, newest, price_low_to_high, price_high_to_low or nearest.",
                    "example": "best_match"
                  },
                  "delivery": {
                    "type": "string",
                    "description": "all, pickup or shipping.",
                    "example": "all"
                  },
                  "categoryId": {
                    "type": "string",
                    "description": "Only one category: a key (vehicles, propertyrentals, electronics, …) or its numeric id."
                  },
                  "includePhotos": {
                    "type": "boolean",
                    "description": "Also return every photo of each listing. Slower.",
                    "example": "false"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "How many listings to return, 1-500. 1 credit per 24 listings returned, minimum 1.",
                    "example": "24"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue from a previous response’s nextCursor, passed back unchanged with the same other parameters. A cursor with changed parameters is a 400."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP the default is markdown; the REST API returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000-110000); a value outside that range is a 400. When it runs out, a listing walk returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "query"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "road bike",
                    "city": "london",
                    "maxPrice": 400,
                    "sortBy": "newest",
                    "limit": 24
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always \"facebook-marketplace\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as a list that stopped early. Empty when there are none."
                    },
                    "search": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "{ query, category, latitude, longitude, radiusKm }: what was searched (the one not used is null), the point searched around and the radius."
                    },
                    "listingCount": {
                      "type": "number",
                      "description": "How many listings are in this response. The price is set from it."
                    },
                    "listings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The listing’s id. /listing-detail takes it."
                          },
                          "url": {
                            "type": "string",
                            "description": "The listing’s page on facebook.com."
                          },
                          "title": {
                            "type": "string",
                            "description": "As listed."
                          },
                          "price": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "{ amount, currency, formatted }: the amount, its ISO currency code when known (a bare $ outside the US is null rather than guessed), and the price as shown."
                          },
                          "originalPrice": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "The price before a reduction."
                          },
                          "priceRange": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "A price range, when the listing shows one instead of a single price."
                          },
                          "photo": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "The main photo: { url, width, height, caption }. width, height and caption are null when Facebook leaves them out. Photo links expire after a few days."
                          },
                          "hasVideo": {
                            "type": "boolean",
                            "description": "Whether the listing has a video."
                          },
                          "location": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "{ city, state, postalCode, latitude, longitude, displayName }: the area as Facebook names it. In results postalCode, latitude and longitude are null: results carry no map point."
                          },
                          "postedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the listing was posted (ISO 8601)."
                          },
                          "categoryId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The listing’s numeric category id."
                          },
                          "status": {
                            "type": "string",
                            "description": "available, pending or sold."
                          },
                          "delivery": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "{ pickup, shipping, publicMeetup, doorPickup }."
                          },
                          "seller": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "{ name, id }: the display name shown on the listing, and an id stable for linking listings by the same seller within these results (not a profile id). Many sellers are private people: treat it as personal data."
                          },
                          "subtitles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Extra lines on the card, such as a vehicle’s mileage. Often empty."
                          },
                          "photos": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Every photo, with includePhotos; otherwise null."
                          }
                        }
                      },
                      "description": "The listings."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "false is the end. true with nextCursor continues; true with nextCursor null means Marketplace reports more but gave no way to read it, and a note says so."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass back unchanged as cursor, with the same other parameters, to continue."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "facebook-marketplace",
                      "notes": [],
                      "search": {
                        "query": "road bike",
                        "category": null,
                        "latitude": 51.5072,
                        "longitude": -0.1276,
                        "radiusKm": 65
                      },
                      "listingCount": 24,
                      "listings": [
                        {
                          "id": "1000000000000001",
                          "url": "https://www.facebook.com/marketplace/item/1000000000000001/",
                          "title": "Example road bike, 54 cm frame",
                          "price": {
                            "amount": 250,
                            "currency": "GBP",
                            "formatted": "£250"
                          },
                          "originalPrice": null,
                          "priceRange": null,
                          "photo": {
                            "url": "https://scontent.xx.fbcdn.net/v/…/example.jpg",
                            "width": null,
                            "height": null,
                            "caption": null
                          },
                          "hasVideo": false,
                          "location": {
                            "city": "London",
                            "state": "England",
                            "postalCode": null,
                            "latitude": null,
                            "longitude": null,
                            "displayName": "London, United Kingdom"
                          },
                          "postedAt": "2026-11-24T09:15:00.000Z",
                          "categoryId": "1658310421102081",
                          "status": "available",
                          "delivery": {
                            "pickup": true,
                            "shipping": false,
                            "publicMeetup": true,
                            "doorPickup": false
                          },
                          "seller": {
                            "name": "Example Seller",
                            "id": "example-id"
                          },
                          "subtitles": [],
                          "photos": null
                        }
                      ],
                      "hasMore": true,
                      "nextCursor": "z.eJyrVkrOzytJzSvRS…"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/category-listings": {
      "post": {
        "operationId": "category-listings",
        "tags": [
          "Listings"
        ],
        "summary": "Browse a category",
        "description": "The listings in one category (vehicles, propertyrentals, electronics, furniture, …) around a city or a point, with a price range. This feed has no condition, age or sort filters. Vehicle listings add a mileage line to subtitles. An unknown category is a 404. Up to 500 a request, with nextCursor for more. 1 credit per 24 listings returned, minimum 1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "category": {
                    "type": "string",
                    "description": "The category key in a Marketplace URL (vehicles, propertyrentals, electronics, furniture, …) or a numeric category id."
                  },
                  "city": {
                    "type": "string",
                    "description": "Where to search: a place /locations lists (its slug, such as london or nyc) or the city key of a Marketplace URL (facebook.com/marketplace/<city>/). Or give latitude and longitude instead."
                  },
                  "latitude": {
                    "type": "number",
                    "description": "With longitude: search around this point, anywhere Marketplace is available. Both or neither."
                  },
                  "longitude": {
                    "type": "number",
                    "description": "With latitude."
                  },
                  "radiusKm": {
                    "type": "integer",
                    "description": "How far around, 1-500 km. Facebook treats it as a guide, so some listings may lie a little outside it.",
                    "example": "65"
                  },
                  "minPrice": {
                    "type": "integer",
                    "description": "Lowest price, in whole units of the local currency (50 = $50 in the US)."
                  },
                  "maxPrice": {
                    "type": "integer",
                    "description": "Highest price, in whole units of the local currency."
                  },
                  "includePhotos": {
                    "type": "boolean",
                    "description": "Also return every photo of each listing. Slower.",
                    "example": "false"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "How many listings to return, 1-500. 1 credit per 24 listings returned, minimum 1.",
                    "example": "24"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue from a previous response’s nextCursor, passed back unchanged with the same other parameters. A cursor with changed parameters is a 400."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP the default is markdown; the REST API returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000-110000); a value outside that range is a 400. When it runs out, a listing walk returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "category"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "category": "vehicles",
                    "city": "la",
                    "maxPrice": 8000,
                    "limit": 24
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always \"facebook-marketplace\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as a list that stopped early. Empty when there are none."
                    },
                    "search": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "{ query, category, latitude, longitude, radiusKm }: what was searched (the one not used is null), the point searched around and the radius."
                    },
                    "listingCount": {
                      "type": "number",
                      "description": "How many listings are in this response. The price is set from it."
                    },
                    "listings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The listing’s id. /listing-detail takes it."
                          },
                          "url": {
                            "type": "string",
                            "description": "The listing’s page on facebook.com."
                          },
                          "title": {
                            "type": "string",
                            "description": "As listed."
                          },
                          "price": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "{ amount, currency, formatted }: the amount, its ISO currency code when known (a bare $ outside the US is null rather than guessed), and the price as shown."
                          },
                          "originalPrice": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "The price before a reduction."
                          },
                          "priceRange": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "A price range, when the listing shows one instead of a single price."
                          },
                          "photo": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "The main photo: { url, width, height, caption }. width, height and caption are null when Facebook leaves them out. Photo links expire after a few days."
                          },
                          "hasVideo": {
                            "type": "boolean",
                            "description": "Whether the listing has a video."
                          },
                          "location": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "{ city, state, postalCode, latitude, longitude, displayName }: the area as Facebook names it. In results postalCode, latitude and longitude are null: results carry no map point."
                          },
                          "postedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the listing was posted (ISO 8601)."
                          },
                          "categoryId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The listing’s numeric category id."
                          },
                          "status": {
                            "type": "string",
                            "description": "available, pending or sold."
                          },
                          "delivery": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "{ pickup, shipping, publicMeetup, doorPickup }."
                          },
                          "seller": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "{ name, id }: the display name shown on the listing, and an id stable for linking listings by the same seller within these results (not a profile id). Many sellers are private people: treat it as personal data."
                          },
                          "subtitles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Extra lines on the card, such as a vehicle’s mileage. Often empty."
                          },
                          "photos": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Every photo, with includePhotos; otherwise null."
                          }
                        }
                      },
                      "description": "The listings."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "false is the end. true with nextCursor continues; true with nextCursor null means Marketplace reports more but gave no way to read it, and a note says so."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass back unchanged as cursor, with the same other parameters, to continue."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "facebook-marketplace",
                      "notes": [],
                      "search": {
                        "query": null,
                        "category": "vehicles",
                        "latitude": 34.0522,
                        "longitude": -118.2437,
                        "radiusKm": 65
                      },
                      "listingCount": 24,
                      "listings": [
                        {
                          "id": "1000000000000002",
                          "url": "https://www.facebook.com/marketplace/item/1000000000000002/",
                          "title": "2016 Example Sedan LE",
                          "price": {
                            "amount": 7500,
                            "currency": "USD",
                            "formatted": "$7,500"
                          },
                          "originalPrice": null,
                          "priceRange": null,
                          "photo": {
                            "url": "https://scontent.xx.fbcdn.net/v/…/example.jpg",
                            "width": null,
                            "height": null,
                            "caption": null
                          },
                          "hasVideo": false,
                          "location": {
                            "city": "Los Angeles",
                            "state": "CA",
                            "postalCode": null,
                            "latitude": null,
                            "longitude": null,
                            "displayName": "Los Angeles, California"
                          },
                          "postedAt": "2026-11-24T09:15:00.000Z",
                          "categoryId": "1658310421102081",
                          "status": "available",
                          "delivery": {
                            "pickup": true,
                            "shipping": false,
                            "publicMeetup": true,
                            "doorPickup": false
                          },
                          "seller": {
                            "name": "Example Motors",
                            "id": "example-id"
                          },
                          "subtitles": [
                            "98K miles"
                          ],
                          "photos": null
                        }
                      ],
                      "hasMore": true,
                      "nextCursor": "z.eJyrVkrOzytJzSvRS…"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/listing-detail": {
      "post": {
        "operationId": "listing-detail",
        "tags": [
          "Listing detail"
        ],
        "summary": "Read one listing in full",
        "description": "One listing in full: title, price, description, condition, attributes, every photo, category, delivery and shipping price, an approximate map point Facebook publishes for it (never an address), and for vehicles the make, model, year, mileage and more, for rentals the postal code and walk, transit and bike scores. A listing that no longer exists or is not public is a 404. 1 credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "listing": {
                    "type": "string",
                    "description": "The listing’s URL (https://www.facebook.com/marketplace/item/1234567890/) or numeric id."
                  },
                  "includePhotos": {
                    "type": "boolean",
                    "description": "Every photo.",
                    "example": "true"
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown; any other value is a 400. Over MCP the default is markdown; the REST API returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000-110000); a value outside that range is a 400. When it runs out, a listing walk returns what it has with nextCursor and a note, billed for what it returned; a request with nothing to return yet fails with a retryable 503. We answer at the latest about 2 seconds before timeoutMs runs out (15% of it, at least 0.75 s, for limits under 13 seconds). Send timeoutMs equal to your own client’s timeout: then we can answer in time, fast, instead of your client dropping the connection while the request is still running."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "listing"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "listing": "https://www.facebook.com/marketplace/item/1000000000000002/"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always \"facebook-marketplace\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as a list that stopped early. Empty when there are none."
                    },
                    "listing": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "A listing card’s fields except photo (see photos), categoryId (see category), priceRange, hasVideo and subtitles, plus the fields below.",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "description": "item, vehicle, property (rentals) or other."
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The seller’s text. It can hold personal details; treat it as personal data."
                        },
                        "condition": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "{ code, label }, such as used_like_new and \"Used - like new\". code can be broader than the condition filter (used), and label can be null."
                        },
                        "attributes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "Other listed attributes: { name, value, label }."
                        },
                        "photos": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "Every photo, in order; empty with includePhotos false. Links expire after a few days."
                        },
                        "location": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Adds latitude and longitude: an approximate point Facebook publishes for the listing, not an address. Rentals add postalCode."
                        },
                        "category": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "{ id, slug, name }. slug and name can be null."
                        },
                        "shippingPrice": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "As shown, when the listing ships."
                        },
                        "vehicle": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "For vehicles: make, model, trim, year, mileage { value, unit }, transmission, fuelType, colours, vin, owners, titleStatus, paidOff, sellerType (private or dealer), dealerName, features, fuelEconomy. Fields the seller left out are null."
                        },
                        "property": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "For rentals: postalCode, walkScore, transitScore, bikeScore, virtualTourUrl. Some rentals do not show when they were posted; postedAt is then null and a note says so."
                        }
                      }
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "facebook-marketplace",
                      "notes": [],
                      "listing": {
                        "id": "1000000000000002",
                        "url": "https://www.facebook.com/marketplace/item/1000000000000002/",
                        "kind": "vehicle",
                        "title": "2016 Example Sedan LE",
                        "description": "Example description.",
                        "price": {
                          "amount": 7500,
                          "currency": "USD",
                          "formatted": "$7,500"
                        },
                        "originalPrice": null,
                        "condition": null,
                        "attributes": [],
                        "photos": [
                          {
                            "url": "https://scontent.xx.fbcdn.net/v/…/example.jpg",
                            "width": null,
                            "height": null,
                            "caption": null
                          }
                        ],
                        "location": {
                          "city": "Los Angeles",
                          "state": "CA",
                          "postalCode": null,
                          "latitude": 34.05,
                          "longitude": -118.24,
                          "displayName": "Los Angeles, CA"
                        },
                        "postedAt": "2026-11-24T09:15:00.000Z",
                        "category": {
                          "id": "807311116002614",
                          "slug": "vehicles",
                          "name": "Vehicles"
                        },
                        "status": "available",
                        "delivery": {
                          "pickup": true,
                          "shipping": false,
                          "publicMeetup": true,
                          "doorPickup": false
                        },
                        "shippingPrice": null,
                        "seller": {
                          "name": "Example Motors",
                          "id": "example-id"
                        },
                        "vehicle": {
                          "make": "Example",
                          "model": "Sedan",
                          "trim": "LE",
                          "year": 2016,
                          "mileage": {
                            "value": 98000,
                            "unit": "miles"
                          },
                          "transmission": "automatic",
                          "fuelType": "gasoline",
                          "exteriorColor": "silver",
                          "interiorColor": "black",
                          "vin": null,
                          "owners": null,
                          "titleStatus": "clean",
                          "paidOff": null,
                          "sellerType": "dealer",
                          "dealerName": "Example Motors",
                          "features": [],
                          "fuelEconomy": null
                        },
                        "property": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/locations": {
      "post": {
        "operationId": "locations",
        "tags": [
          "Utilities"
        ],
        "summary": "Places to search around",
        "description": "The places a search can be centred on by name: each with name, slug (pass it as city), country, latitude and longitude. Anywhere else, search by latitude and longitude. Up to 50. Free.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "A place name or part of one; empty lists the first places."
                  },
                  "country": {
                    "type": "string",
                    "description": "Only places in this country (two letters, such as US or GB)."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "How many places, 1-50.",
                    "example": "10"
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown.",
                    "example": "json"
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "san",
                    "country": "US",
                    "limit": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always \"facebook-marketplace\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as a list that stopped early. Empty when there are none."
                    },
                    "locationCount": {
                      "type": "number",
                      "description": "How many places are in this response."
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "{ name, slug, country, latitude, longitude }."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "facebook-marketplace",
                      "notes": [],
                      "locationCount": 2,
                      "locations": [
                        {
                          "name": "San Francisco",
                          "slug": "sanfrancisco",
                          "country": "US",
                          "latitude": 37.7749,
                          "longitude": -122.4194
                        },
                        {
                          "name": "San Diego",
                          "slug": "sandiego",
                          "country": "US",
                          "latitude": 32.7157,
                          "longitude": -117.1611
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/resolve-url": {
      "post": {
        "operationId": "resolve-url",
        "tags": [
          "Utilities"
        ],
        "summary": "Parse a Marketplace link",
        "description": "What a facebook.com Marketplace link is (a listing, a search, a category or a city page), with its listing id, city, category and query, and the tool and arguments that read it, the link’s filters translated into this API’s parameters. Fetches nothing and is free.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Any facebook.com Marketplace URL."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown.",
                    "example": "json"
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "url": "https://www.facebook.com/marketplace/nyc/search/?query=bike&maxPrice=200"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always \"facebook-marketplace\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on, such as a list that stopped early. Empty when there are none."
                    },
                    "type": {
                      "type": "string",
                      "description": "listing, search, category, city or unknown."
                    },
                    "listingId / city / category / query": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "What the link carries."
                    },
                    "next": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true,
                      "description": "The tool and arguments that read it: { tool, arguments }."
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "facebook-marketplace",
                      "notes": [],
                      "type": "search",
                      "listingId": null,
                      "city": "nyc",
                      "category": null,
                      "query": "bike",
                      "next": {
                        "tool": "facebook_marketplace_search_listings",
                        "arguments": {
                          "query": "bike",
                          "city": "nyc",
                          "maxPrice": 200
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/media": {
      "get": {
        "operationId": "media",
        "tags": [
          "Utilities"
        ],
        "summary": "Download a photo",
        "description": "Streams a photo a result returned, by its link, with Range support. Only Marketplace photo links are accepted. Photo links expire after a few days: read the listing again for fresh ones. 1 credit per request.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "A photo link as a result gave it (photo.url or photos[].url). Only Marketplace photo links; anything else is a 400.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  }
}