{
  "openapi": "3.0.1",
  "info": {
    "title": "Leboncoin Scraper",
    "description": "Scrape Leboncoin.fr ads by keyword, city, department, category or any search URL: title, price as a number, postcode and coordinates, posting date, full description, attributes like surface or mileage, seller type and rating, photos. Export JSON/CSV, call the API, schedule new-ads feeds.",
    "version": "0.1",
    "x-build-id": "K874FXHt7wQoeKNtU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lergassy~leboncoin-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lergassy-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/lergassy~leboncoin-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lergassy-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/lergassy~leboncoin-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lergassy-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": {
          "searchQueries": {
            "title": "🔍 Search keywords",
            "type": "array",
            "description": "Give this or <code>startUrls</code>. One or more keywords, searched one after another on Leboncoin — the same words you would type into the search box, e.g. <code>iphone 15</code>, <code>vélo électrique</code>, <code>appartement t3</code>. Combine with <b>Location</b>, <b>Category</b>, price and seller filters below.",
            "items": {
              "type": "string"
            }
          },
          "titleOnly": {
            "title": "Search in titles only",
            "type": "boolean",
            "description": "On: keywords must appear in the ad title (Leboncoin's “Rechercher dans le titre uniquement”). Off (default): titles and descriptions are searched, which finds more ads but also some that only mention the word.",
            "default": false
          },
          "location": {
            "title": "📍 Location",
            "type": "string",
            "description": "Where to search: a city (<code>Lyon</code>), a postcode (<code>69001</code>), a department number or name (<code>33</code>, <code>Gironde</code>) or a region (<code>Bretagne</code>, <code>Île-de-France</code>). Several places separated by commas are searched together, e.g. <code>Paris, Lyon</code>. Leave empty for all of France. Used with keywords or a category."
          },
          "category": {
            "title": "Category",
            "enum": [
              "all",
              "immobilier",
              "ventes_immobilieres",
              "locations",
              "locations_saisonnieres",
              "vehicules",
              "voitures",
              "motos",
              "utilitaires",
              "electronique",
              "telephones",
              "ordinateurs",
              "consoles",
              "maison_jardin",
              "ameublement",
              "electromenager",
              "vetements",
              "velos",
              "sport_plein_air",
              "emploi"
            ],
            "type": "string",
            "description": "Limit keyword searches to one Leboncoin category. Works alone too: a category + a location lists everything in it (e.g. all rentals in Lyon). For any other category use <b>Category id</b> in the advanced section.",
            "default": "all"
          },
          "minPrice": {
            "title": "Min price (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads priced at least this many euros. Applied by Leboncoin itself and checked again on every row; ads without a price are left out when a price filter is set."
          },
          "maxPrice": {
            "title": "Max price (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads priced at most this many euros. Applied by Leboncoin itself and checked again on every row."
          },
          "sellerType": {
            "title": "Seller type",
            "enum": [
              "all",
              "private",
              "pro"
            ],
            "type": "string",
            "description": "<b>Private</b> = private individuals only (particuliers), <b>Pro</b> = dealers, agencies and shops only (professionnels), <b>All</b> = both.",
            "default": "all"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "price_asc",
              "price_desc"
            ],
            "type": "string",
            "description": "Order of keyword and category searches. <b>Most relevant</b> (default) is what the site shows first; <b>Newest first</b> suits monitoring new ads. Start URLs keep the sorting chosen on the site.",
            "default": "relevance"
          },
          "maxItems": {
            "title": "💯 Max ads per search",
            "minimum": 1,
            "maximum": 3500,
            "type": "integer",
            "description": "Maximum ads to return for each keyword or start URL. Leboncoin itself serves at most 3,500 ads per search — split bigger searches by department, category or price range to get more.",
            "default": 30
          },
          "startUrls": {
            "title": "🔗 Leboncoin URLs",
            "type": "array",
            "description": "Give this or <code>searchQueries</code>. Search or category links copied from leboncoin.fr — every filter you set on the site (category, place, price, surface, mileage, sorting…) is kept, e.g. <code>https://www.leboncoin.fr/recherche?category=10&locations=Lyon</code>. Ad links (<code>/ad/…/123456789</code>) return that one ad.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "onlyNewRowsStore": {
            "title": "🔁 Only new ads — memory name",
            "pattern": "^[A-Za-z0-9-]{0,63}$",
            "type": "string",
            "description": "Give this run a name — <code>my-lyon-flats</code> — and the Actor remembers every ad it delivered under that name. Every later run with the same name writes and charges <b>only ads you have not received before</b>. Schedule the Actor (e.g. hourly) to get a feed of new ads. Leave empty to get everything found, every time."
          },
          "categoryId": {
            "title": "Category id",
            "type": "string",
            "description": "Any Leboncoin category by its number, taken from a search URL (<code>…&category=41</code> → <code>41</code>, Jeux & Jouets). Overrides <b>Category</b>. Examples: 28 Animaux, 41 Jeux & Jouets, 40 Collection, 57 Matériel agricole, 11 Colocations."
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many result pages are loaded at the same time. The default is fast and polite; lower it if you see errors.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Leave empty: the Actor picks French residential addresses by itself (Leboncoin refuses datacenter addresses). Set a proxy here only if you must use your own — it is then used as given."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}