{
  "openapi": "3.0.1",
  "info": {
    "title": "OLX Public Classified Listing Scraper",
    "description": "Collects public OLX classified listings through a built-in OLX India search mode or supplied public search, category, and ad URLs. Optional deep scraping adds descriptions, sellers, locations, images, phones, and specifications.",
    "version": "1.2",
    "x-build-id": "V34sUCOTkDkhhVf7N"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/w3crawler~olx-global-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-w3crawler-olx-global-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/w3crawler~olx-global-scraper/runs": {
      "post": {
        "operationId": "runs-sync-w3crawler-olx-global-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/w3crawler~olx-global-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-w3crawler-olx-global-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": {
          "mode": {
            "title": "Scraping Mode",
            "enum": [
              "search",
              "adUrl",
              "searchUrl",
              "categoryUrl"
            ],
            "type": "string",
            "description": "Select the type of input you want to scrape from",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search Query",
            "maxLength": 300,
            "type": "string",
            "description": "Search term for the built-in OLX India search. For other countries, use Search URL or Category URL mode.",
            "default": "iphone"
          },
          "countryCode": {
            "title": "Search Country",
            "enum": [
              "IN",
              "PL",
              "UA",
              "BR",
              "PK",
              "ID",
              "AR",
              "TR",
              "PT",
              "KZ",
              "RO",
              "BG",
              "BA",
              "UZ",
              "LK",
              "PH",
              "KE",
              "ZA",
              "EG",
              "NG",
              "GH",
              "TN",
              "MA",
              "DZ"
            ],
            "type": "string",
            "description": "Two-letter OLX country code used only by built-in search mode. URL modes infer the country from the supplied URL.",
            "default": "IN"
          },
          "adUrls": {
            "title": "Ad URLs",
            "maxItems": 100,
            "type": "array",
            "description": "Public listing URLs from supported OLX country sites.",
            "items": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "searchUrl": {
            "title": "Search URL",
            "minLength": 1,
            "maxLength": 2000,
            "type": "string",
            "description": "Full public OLX country search URL."
          },
          "categoryUrl": {
            "title": "Category URL",
            "minLength": 1,
            "maxLength": 2000,
            "type": "string",
            "description": "Full public OLX country category URL."
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of items to scrape",
            "default": 50
          },
          "deepScraping": {
            "title": "Deep Scraping",
            "type": "boolean",
            "description": "Enable deep scraping to extract detailed ad information including seller info, description, location, etc.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional standard Apify Proxy configuration. Direct access is the default; credentials are resolved by the SDK and never written to logs or records.",
            "properties": {
              "useApifyProxy": {
                "title": "Use Apify Proxy",
                "type": "boolean",
                "description": "Route ordinary public OLX requests through Apify Proxy when true."
              },
              "apifyProxyGroups": {
                "title": "Apify Proxy groups",
                "type": "array",
                "description": "Optional account-enabled Apify Proxy groups. Requires useApifyProxy=true.",
                "items": {
                  "type": "string"
                }
              },
              "apifyProxyCountry": {
                "title": "Apify Proxy country",
                "type": "string",
                "description": "Optional two-letter Apify Proxy country code. Requires useApifyProxy=true.",
                "pattern": "^[A-Za-z]{2}$"
              }
            },
            "default": {
              "useApifyProxy": false
            },
            "additionalProperties": false
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Safety cap on public search/category pages.",
            "default": 5
          },
          "timeoutMs": {
            "title": "Request timeout (ms)",
            "minimum": 5000,
            "maximum": 60000,
            "type": "integer",
            "description": "Maximum time to wait for each public response.",
            "default": 30000
          },
          "maxBytes": {
            "title": "Maximum response bytes",
            "minimum": 1000,
            "maximum": 10000000,
            "type": "integer",
            "description": "Safety limit for each public response.",
            "default": 5000000
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional bounded delay between public requests.",
            "default": 250
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Retry budget for transient public-request failures.",
            "default": 1
          },
          "fixturePath": {
            "title": "Explicit fixture path (QA only)",
            "maxLength": 260,
            "type": "string",
            "description": "Optional checked-in relative fixture for local validation; it never replaces a failed live request unless explicitly supplied."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}