{
  "openapi": "3.0.1",
  "info": {
    "title": "Lianjia Scraper: Resale Listings, Price, Community",
    "description": "Scrape Lianjia (链家) resale listings across 12 major Chinese cities. Get total price, price per sqm, community, area, and layout. Perfect for Excel, Google Sheets, or any BI tool. Skip manual copy-pasting or expensive broker fees. $2.50 per 1,000 results.",
    "version": "0.0",
    "x-build-id": "rkrSoS69hEwox2Rsk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/getascraper~lianjia-real-estate-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-getascraper-lianjia-real-estate-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/getascraper~lianjia-real-estate-scraper/runs": {
      "post": {
        "operationId": "runs-sync-getascraper-lianjia-real-estate-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/getascraper~lianjia-real-estate-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-getascraper-lianjia-real-estate-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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Optional verified Lianjia or Beike URLs. Use a resale search, a resale detail URL, or a community URL. Unknown city subdomains produce an explicit error row.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "Source URL",
                  "type": "string",
                  "description": "A public Lianjia or Beike URL."
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "resaleHousingList",
              "resaleHousingDetail",
              "communityList"
            ],
            "type": "string",
            "description": "Resale Housing List returns listing cards, Resale Housing Detail returns one house, and Community List returns neighborhood cards.",
            "default": "resaleHousingList"
          },
          "cityId": {
            "title": "Verified City",
            "enum": [
              "110000",
              "310000",
              "440100",
              "440300",
              "330100",
              "510100",
              "320100",
              "420100",
              "610100",
              "120000",
              "500000",
              "210100"
            ],
            "type": "string",
            "description": "Verified city ID used when startUrls is empty. Unknown IDs are reported as UNSUPPORTED_CITY instead of being mapped to a fabricated city.",
            "default": "110000"
          },
          "houseCode": {
            "title": "Listing House Code",
            "pattern": "^[0-9]{10,20}$",
            "type": "string",
            "description": "Required for resaleHousingDetail when no detail start URL is supplied."
          },
          "maxPages": {
            "title": "Max Pages",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Pages to fetch for list operations. Zero is treated as one source page. Maximum 100.",
            "default": 5
          },
          "maxItems": {
            "title": "Max Returned Records",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum filtered records returned. If capped, removal detection is disabled for that run to avoid false REMOVED events.",
            "default": 10000
          },
          "district": {
            "title": "District",
            "type": "string",
            "description": "Exact district label found in the source listing or community card. Records without a source district do not match this filter."
          },
          "districts": {
            "title": "Districts",
            "type": "array",
            "description": "Exact source district labels.",
            "items": {
              "type": "string"
            }
          },
          "minPriceTotal": {
            "title": "Minimum Total Price (万)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum source total price in ten-thousand yuan units."
          },
          "maxPriceTotal": {
            "title": "Maximum Total Price (万)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum source total price in ten-thousand yuan units."
          },
          "minUnitPrice": {
            "title": "Minimum Price per ㎡ (元)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum published unit price in yuan per square meter."
          },
          "maxUnitPrice": {
            "title": "Maximum Price per ㎡ (元)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum published unit price in yuan per square meter."
          },
          "minPricePerSqm": {
            "title": "Minimum Price per ㎡ Alias (元)",
            "minimum": 0,
            "type": "number",
            "description": "Alias for the minimum published unit price."
          },
          "maxPricePerSqm": {
            "title": "Maximum Price per ㎡ Alias (元)",
            "minimum": 0,
            "type": "number",
            "description": "Alias for the maximum published unit price."
          },
          "rooms": {
            "title": "Exact Bedroom Counts",
            "type": "array",
            "description": "Only source bedroom counts matching one of these values are returned.",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "minRooms": {
            "title": "Minimum Bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum source bedroom count."
          },
          "maxRooms": {
            "title": "Maximum Bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum source bedroom count."
          },
          "minArea": {
            "title": "Minimum Area (㎡)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum published floor area in square meters."
          },
          "maxArea": {
            "title": "Maximum Area (㎡)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum published floor area in square meters."
          },
          "minFreshnessDays": {
            "title": "Minimum Listing Age (days)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum age parsed from an explicit source freshness label."
          },
          "maxFreshnessDays": {
            "title": "Maximum Listing Age (days)",
            "minimum": 0,
            "type": "number",
            "description": "Uses only explicit source age labels such as 2天前 or 8月前. Unknown freshness does not match a freshness filter."
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "houseCode",
              "communityId",
              "priceTotal",
              "unitPrice",
              "area",
              "bedroomNum",
              "freshnessDays",
              "avgUnitPrice",
              "onSaleCount"
            ],
            "type": "string",
            "description": "Deterministic source-field sort with stable source ID tie-breaking.",
            "default": "houseCode"
          },
          "sortOrder": {
            "title": "Sort Order",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Ascending or descending order for the selected sort field.",
            "default": "asc"
          },
          "monitorMode": {
            "title": "Monitor Mode",
            "enum": [
              "snapshot",
              "changes"
            ],
            "type": "string",
            "description": "Snapshot returns current source records and their transition labels. Changes returns only non-UNCHANGED records unless includeUnchanged is enabled.",
            "default": "snapshot"
          },
          "stateKey": {
            "title": "State Key",
            "pattern": "^[A-Za-z0-9!_.'()\\-]{1,256}$",
            "type": "string",
            "description": "Explicit key-value store key for the monitored scope. Reuse it across scheduled runs to detect changes."
          },
          "includeUnchanged": {
            "title": "Include Unchanged",
            "type": "boolean",
            "description": "In changes mode, also emit records classified as UNCHANGED.",
            "default": false
          },
          "includeOpportunityScore": {
            "title": "Include Opportunity Score",
            "type": "boolean",
            "description": "Adds a relative score only when source fields have a measurable range in this returned cohort. No score is emitted when it cannot be computed.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Residential proxy is enabled by default because the source rate-limits repeated requests by IP.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}