{
  "openapi": "3.0.1",
  "info": {
    "title": "leboncoin Scraper",
    "description": "Scrape French classified ads from leboncoin: price and currency, seller type and company number, location down to coordinates, every photograph, and the seller's full structured attribute set. Promoted adverts are labelled, not passed off as matches.",
    "version": "0.1",
    "x-build-id": "uu3gaxe1NkqsIK6a3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s-r~leboncoin-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s-r-leboncoin-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/s-r~leboncoin-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s-r-leboncoin-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/s-r~leboncoin-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s-r-leboncoin-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "title": "Search text",
            "type": "string",
            "description": "What to search for, exactly as you would type it on the site, for example \"iphone 15\" or \"golf gtd\". Leave it empty to browse a whole category."
          },
          "category": {
            "title": "Category",
            "enum": [
              "all",
              "vehicles",
              "cars",
              "motorbikes",
              "utility_vehicles",
              "caravans_motorhomes",
              "car_parts",
              "real_estate",
              "property_for_sale",
              "property_to_rent",
              "flatshare",
              "computers",
              "phones",
              "home_and_garden",
              "household_appliances",
              "fashion",
              "leisure",
              "sport_and_outdoors",
              "musical_instruments",
              "jobs"
            ],
            "type": "string",
            "description": "Restrict the search to one section of the site. Narrowing the category is also the cleanest way to keep off-topic results out of a broad keyword search. Every option here was checked by running it and reading the category back off the returned ads.",
            "default": "all"
          },
          "url": {
            "title": "Search URL",
            "type": "string",
            "description": "A leboncoin search URL to read instead of the fields below. Apply the filters you want on the site and paste the resulting address here; anything the site can filter on works this way."
          },
          "price_min": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "integer",
            "description": "Lower price bound in euros. Every price on leboncoin is in euros."
          },
          "price_max": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "Upper price bound in euros."
          },
          "seller_type": {
            "title": "Seller type",
            "enum": [
              "any",
              "private",
              "professional"
            ],
            "type": "string",
            "description": "Private sellers, professional sellers, or both. Professionals carry a company registration number on the row.",
            "default": "any"
          },
          "locations": {
            "title": "Location",
            "type": "string",
            "description": "Where to search. Use a department as d_75 or a region as r_12, or copy a location expression out of a leboncoin search URL. A bare town name with a postcode is accepted by the site and matches nothing, so it is rejected here instead."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "newest",
              "oldest",
              "price_asc",
              "price_desc"
            ],
            "type": "string",
            "description": "Result order. Every option here was checked by reading the returned ads back, not just by the site accepting the parameter.",
            "default": "relevance"
          },
          "include_injected_ads": {
            "title": "Include injected adverts",
            "type": "boolean",
            "description": "leboncoin drops two promoted adverts into every result page and they often have nothing to do with the search. They are excluded by default; switch this on to receive them, flagged in the is_injected_ad field.",
            "default": false
          },
          "limit": {
            "title": "Maximum ads",
            "minimum": 1,
            "maximum": 3500,
            "type": "integer",
            "description": "How many ads to return, 1 to 3500. A page carries 35 and the site caps a search at 100 pages, so 3500 is the real ceiling for one query.",
            "default": 50
          },
          "retries": {
            "title": "Retries per page",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Retry attempts per page, each one a differently shaped client on a fresh route. Raise it if a run reports pages that were not served.",
            "default": 5
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}