> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Marketplace Search

> Search public Facebook Marketplace listings.

# Marketplace Search

Search public listings around a geographic coordinate. Use [Marketplace Location Search](/api-manual/facebook-marketplace/location-search) to find coordinates when needed.

## Request Example

```json theme={"system"}
{
  "query": "bike",
  "latitude": 30.2677,
  "longitude": -97.7475,
  "results_limit": 100,
  "radius_km": 65,
  "min_price": 100,
  "max_price": 500,
  "sort_by": "creation_time_descend",
  "delivery_method": "local_pickup",
  "condition": "used_good",
  "date_listed": "last_7_days",
  "availability": "available"
}
```

## Use with MCP

| Interface      | Value                                                         |
| -------------- | ------------------------------------------------------------- |
| REST           | `POST /v1/facebook-marketplace/search`                        |
| Compact MCP    | `socq_execute` with `endpoint: "facebook-marketplace/search"` |
| Typed MCP      | `socq_facebook_marketplace_search`                            |
| Exact-tool URL | `https://api.socq.ai/mcp?tools=facebook_marketplace_search`   |
| CLI            | `socq facebook-marketplace search`                            |

Use the JSON request body above as the nested `input` object for `socq_execute`, or pass the same fields directly to the typed tool. Typed tools also accept `_wait_seconds`, `_result_limit`, and `_idempotency_key`.

<Info>
  A successful collection returns a `task_id`. Continue with `socq_get_task` until the task succeeds, then read normalized records from `results.items`.
</Info>

See [MCP quickstart](/integrations/mcp) for the complete submission and polling flow.

SocQ follows result pagination until `results_limit` is reached or no additional page is available. Duplicate listing IDs are saved once, so the final `result_count` can be lower than the requested limit.

## Completed Task Response

```json theme={"system"}
{
  "code": 200,
  "data": {
    "task_id": "A1B2C3D4E5F6G7H8",
    "status": "succeeded",
    "public_id": "facebook-marketplace/search",
    "result_count": 1,
    "credits_amount": 0.7,
    "results": {
      "limit": 50,
      "next_cursor": null,
      "has_more": false,
      "items": [{
        "id": "1880804689276480",
        "platform": "facebook-marketplace",
        "resource": "search",
        "type": "listing",
        "url": "https://www.facebook.com/marketplace/item/1880804689276480/",
        "name": "Electric bike",
        "text": null,
        "author": {"id": null, "username": null, "name": null, "url": null},
        "metrics": {},
        "media": [{"type": "image", "url": "https://example.com/bike.jpg", "width": 960, "height": 720}],
        "created_at": null,
        "collected_at": "2026-07-18T10:30:00",
        "extra": {
          "search_query": "bike",
          "price": {"amount": 300, "currency": "USD", "formatted": "$300"},
          "location": {"text": "Austin, Texas", "city": "Austin", "state": "TX"},
          "category_id": "1658310421102081",
          "is_live": true,
          "is_sold": false
        }
      }]
    }
  }
}
```


## OpenAPI

````yaml api-manual/agent-api/agent-api.json POST /v1/facebook-marketplace/search
openapi: 3.1.0
info:
  title: SocQ Agent API
  version: v1-063d1c96173a
  description: Asynchronous social data API generated from the SocQ Capability Registry.
servers:
  - url: https://api.socq.ai
security: []
paths:
  /v1/facebook-marketplace/search:
    post:
      tags:
        - facebook-marketplace
      summary: Facebook Marketplace Search API
      description: Facebook Marketplace Search API
      operationId: socq_facebook_marketplace_search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              additionalProperties: false
              properties:
                availability:
                  type: string
                  minLength: 1
                condition:
                  type: string
                  minLength: 1
                date_listed:
                  type: string
                  minLength: 1
                delivery_method:
                  type: string
                  minLength: 1
                latitude:
                  type: number
                  minimum: -90
                  maximum: 90
                longitude:
                  type: number
                  minimum: -180
                  maximum: 180
                max_price:
                  type: number
                  minimum: 0
                min_price:
                  type: number
                  minimum: 0
                query:
                  type: string
                  minLength: 1
                  description: Search query.
                radius_km:
                  type: number
                  exclusiveMinimum: 0
                results_limit:
                  type: integer
                  minimum: 1
                  maximum: 2000
                sort_by:
                  type: string
                  minLength: 1
              required:
                - latitude
                - longitude
                - query
      responses:
        '200':
          description: Task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSubmitResponse'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    AgentSubmitResponse:
      type: object
      properties:
        code:
          type: integer
          const: 200
        data:
          type: object
          properties:
            task_id:
              type: string
            status:
              type: string
            created_time:
              type:
                - string
                - 'null'
            idempotent_replay:
              type: boolean
          required:
            - task_id
            - status
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````