{
  "openapi": "3.0.1",
  "info": {
    "title": "Leboncoin Scraper - Any Search URL, Full Details",
    "description": "Scrape leboncoin.fr ads from any search URL or category page: voitures, emploi, immobilier and every other category. Get price, full description, location, seller type and SIREN, images and all attributes. New-ads-only mode. $1 per 1,000 ads delivered plus a small per-run start fee. JSON, CSV, API.",
    "version": "1.0",
    "x-build-id": "RQDKhqc9W89Tb53Ij"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/amitaviv~leboncoin-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-amitaviv-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/amitaviv~leboncoin-scraper/runs": {
      "post": {
        "operationId": "runs-sync-amitaviv-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/amitaviv~leboncoin-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-amitaviv-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": {
          "searchUrls": {
            "title": "Leboncoin search URLs",
            "type": "array",
            "description": "Paste one or more leboncoin.fr search result URLs copied from your browser (any category, any filters, any sort), e.g. https://www.leboncoin.fr/recherche?category=2&text=clio&sort=time&order=desc . Category pages (https://www.leboncoin.fr/c/voitures) also work. Scraping always starts at page 1. Keywords alone are not accepted. Required unless \"Individual ad URLs\" is given.",
            "items": {
              "type": "string"
            }
          },
          "maxItemsPerSearch": {
            "title": "Max ads per search URL",
            "minimum": 1,
            "maximum": 35000,
            "type": "integer",
            "description": "Maximum number of ads to return for each search URL, e.g. 500; default 100. Each ad is one record and one charged event. Leboncoin itself serves at most 3,500 ads per search (100 pages of 35). Above 3,500, a larger search is split automatically into price-sorted sub-searches (see \"Split searches larger than 3,500 ads\").",
            "default": 100
          },
          "fetchDetails": {
            "title": "Fetch full ad details",
            "type": "boolean",
            "description": "Default off. Also fetch each ad's own record (slower; same price per ad). Each result has a `detailsFetched` field telling you whether this worked for that ad. If off, you get the data from search results, which in our tests included the description and attributes for every ad, first results page included.",
            "default": false
          },
          "adUrls": {
            "title": "Individual ad URLs (optional)",
            "type": "array",
            "description": "Scrape specific ads by URL, e.g. https://www.leboncoin.fr/ad/voitures/3285027141 (a bare ad id such as 3285027141 also works). Ads that no longer exist are reported in the run's status message and are not charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeRaw": {
            "title": "Include raw ad object",
            "type": "boolean",
            "description": "Default off. Attach the raw JSON from leboncoin under the `raw` field. For private sellers the same identifying fields are removed from it as from the record, unless \"Include private sellers' identity\" is on.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new ads (monitoring)",
            "type": "boolean",
            "description": "Return and charge only ads that earlier runs with this option did not already return for the same search URL. The first run returns the newest ads up to \"Max ads per search URL\" as the starting point; later runs return ads published since, newest first, and ads the monitor has already seen whose price changed (`changeType`: `new` or `price-changed`, with `previousPrice`). If a run cannot return everything new (\"Max ads per search URL\" or the run's maximum charge), the next run returns the rest. A run with nothing new succeeds with \"0 new ads\" and charges nothing. What was returned is remembered in a key-value store named `leboncoin-scraper-monitor` in your own Apify account; delete a record or the store to start over. Applies to search URLs, not to individual ad URLs.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Only with \"Only new ads\". A free-text name such as \"lyon-hourly\". Runs with the same search URL and the same monitor name share one memory of what was returned. Give two schedules different names to track the same search independently. Leave empty for a single monitor per search."
          },
          "skipExistingOnFirstRun": {
            "title": "First run: skip the ads already online",
            "type": "boolean",
            "description": "Only with \"Only new ads\". On the first run of a monitor, record the ads currently at the top of the search as already seen without returning or charging them, so that you only ever receive ads published after you started. Has no effect on later runs, so it can stay on in a schedule. If the search has no ads at all on the first run, every ad that appears later is returned.",
            "default": false
          },
          "splitLargeSearches": {
            "title": "Split searches larger than 3,500 ads",
            "type": "boolean",
            "description": "Has an effect only when \"Max ads per search URL\" is above 3,500 and the search has more than 3,500 ads. The search is then read in ascending price order, one sub-search of up to 3,500 ads after another, each starting at the price where the previous one stopped, and duplicates are removed. Results come in price order instead of the URL's sort order. The status message and OUTPUT_SUMMARY say how many sub-searches ran and whether the whole search was covered. Not used together with \"Only new ads\".",
            "default": true
          },
          "includePrivateSellerData": {
            "title": "Include private sellers' identity",
            "type": "boolean",
            "description": "By default, for ads placed by private individuals, `ownerName`, `ownerUserId`, `ownerStoreId` and the profile photo are removed and `privateDataRedacted` is true. The ad itself, including its location, is not changed. Professional sellers are always returned in full. By turning this on you confirm that you have a lawful basis under the GDPR for processing private individuals' personal data and that you will meet the obligations that come with it.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}