{
  "openapi": "3.0.1",
  "info": {
    "title": "Pagine Gialle Businesses Scraper",
    "description": "Scrape Italian business leads from PagineGialle.it: many activities × places per run, phones (mobile, WhatsApp), e-mail (+ company websites), website, VAT, address, GPS, hours, rating. New-businesses-only monitoring, free lead filters, auto split of searches capped at 200.",
    "version": "0.0",
    "x-build-id": "h6UdZMw9C77W4UCX4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nice_dev~paginegialle-businesses-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nice_dev-paginegialle-businesses-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/nice_dev~paginegialle-businesses-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nice_dev-paginegialle-businesses-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/nice_dev~paginegialle-businesses-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nice_dev-paginegialle-businesses-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": {
          "what": {
            "title": "What (activity)",
            "maxLength": 100,
            "type": "string",
            "description": "Activity, category or business name **in Italian**, as typed in the site's *cosa* box: `ristoranti`, `idraulici`, `avvocati`, `parrucchieri`, `agenzie immobiliari`."
          },
          "searchQueries": {
            "title": "More activities",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Extra activities, one per line (`dentisti`, `idraulici`). Every activity is searched in every place of *Where* + *More places*: 3 activities × 4 places = 12 searches in one run, each with its own *Max businesses per search*.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "where": {
            "title": "Where (place)",
            "maxLength": 100,
            "type": "string",
            "description": "Italian municipality (`milano`, `reggio emilia`), district (`Milano Quartiere Isola`), postal code (`20159`), province code (`MI`, `provincia di milano`) or region (`lombardia`). Leave empty for the whole country (top 200 results only, unless *Expand locations* is on and you paste a region)."
          },
          "locations": {
            "title": "More places",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Extra places, one per line (`roma`, `00122`, `TO`). Crossed with every activity (see *More activities*), within the run's limit of searches (max 500).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Activity | place pairs",
            "maxItems": 500,
            "uniqueItems": true,
            "type": "array",
            "description": "Searches that must NOT be crossed with the lists above, one per line, as `what | where` (e.g. `idraulici | roma`, `dentisti | 00122`). They run in the same dataset, deduplicated by business id.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Pagine Gialle search URLs (`https://www.paginegialle.it/ricerca/idraulici/roma`), category pages (`https://www.paginegialle.it/lombardia/milano/ristoranti.html`, with or without `/p-N` or a district) or single business pages (`https://www.paginegialle.it/ristoranteantico1850`). Used in addition to the fields above. Max 1 000 URLs, of which at most 500 searches or category pages (a run reads at most 500 searches in all).",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxItems": {
            "title": "Max businesses",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of businesses to save in the whole run (after deduplication and filters). 0 = no limit. For reference: the site returns at most 200 results per search; with *Expand locations* on, a big city goes far beyond it (Milano lists 73 districts, each searched up to 200).",
            "default": 100
          },
          "maxItemsPerQuery": {
            "title": "Max businesses per search",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cap of EACH search (activity × place, `what | where` pair, or start URL), its automatic sub-areas included — so the first search cannot use the whole *Max businesses* budget. 0 = no per-search cap.",
            "default": 0
          },
          "extractDetails": {
            "title": "Extract details (visit each business page)",
            "type": "boolean",
            "description": "Off (default): 25 businesses per request with phones, e-mail, website, VAT number, GPS, hours, rating, description already included. On: one extra request per business to add the tax code (codice fiscale), services, payment methods, reviews, social links and photos — and, on category pages, the legal name and the category code. Charged as a separate `business-details` event ($0.70 per 1,000 businesses).",
            "default": false
          },
          "enrichEmails": {
            "title": "Find e-mails on company websites",
            "type": "boolean",
            "description": "Visits each business's own website (home page + contact / legal pages, 3 pages max) and adds the e-mail addresses published there (`websiteEmails`, also merged into `emails`). Slower. Charged as a separate `email-enriched` event, only when the website gives an address Pagine Gialle does not show. Category pages carry no website: combine them with *Extract details*. The websites are read directly, not through the proxy; the run summary says why the others gave no address.",
            "default": false
          },
          "expandLocations": {
            "title": "Expand locations (beat the 200-result cap)",
            "type": "boolean",
            "description": "When a search hits the site's cap of 200 results, automatically re-run it for every sub-area the site lists (region → provinces → municipalities → districts) and deduplicate. Costs one extra page per capped search.",
            "default": true
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "distance",
              "popularity"
            ],
            "type": "string",
            "description": "Order of the site's results (matters when a search is capped at 200): relevance (site default), distance from the place centre, or popularity. Sorting by distance is also what makes the site fill the `distance` field of every item. Category pages keep the site's own order.",
            "default": "relevance"
          },
          "requirePhone": {
            "title": "Only businesses with a phone",
            "type": "boolean",
            "description": "Skip businesses without a phone number. Filtered businesses are not saved and not counted in the caps.",
            "default": false
          },
          "requireEmail": {
            "title": "Only businesses with an e-mail",
            "type": "boolean",
            "description": "Skip businesses without an e-mail address. With *Find e-mails on company websites* on, a business is kept when its website gives one.",
            "default": false
          },
          "requireWebsite": {
            "title": "Only businesses with a website",
            "type": "boolean",
            "description": "Skip businesses without a website. Category pages do not show the website: with them, turn *Extract details* on.",
            "default": false
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Keep businesses rated at least this (1-5, e.g. `4` or `4.5`); unrated businesses are skipped. 0 = off. Use `1` to keep rated businesses only.",
            "default": 0
          },
          "openNowOnly": {
            "title": "Only businesses open right now",
            "type": "boolean",
            "description": "Keep only businesses open at the moment they are scraped. The Actor asks the site for its own \"Aperto ora\" results (far fewer pages to read) and checks the hours again on every item (Italian time). Businesses with no hours and no 24/7 flag are skipped. A pasted search URL that already carries the site's \"Aperto ora\" filter switches this on.",
            "default": false
          },
          "listingTypes": {
            "title": "Listing types",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only these listing types: `paid` (advertisers, richest data), `premium` (top advertisers — recognised on search results only; category pages show them as paid), `free`. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "paid",
                "premium",
                "free"
              ],
              "enumTitles": [
                "Paid",
                "Premium",
                "Free"
              ]
            },
            "default": []
          },
          "categoryCodes": {
            "title": "Category codes",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Keep businesses filed under one of these Pagine Gialle category codes (the `categoryCode` / `categoryCodes` output fields, e.g. `007585100` = restaurants). Search results give every code of a business; a category page gives none — turn *Extract details* on there, the business page gives its main code; a pasted business URL gives its main code.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "categoryContains": {
            "title": "Category contains",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Keep businesses whose category contains one of these words (`pizzeria`, `sushi`).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cityContains": {
            "title": "City contains",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Keep businesses whose municipality contains one of these words — useful after a province or region search (`monza`, `sesto`).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Name contains",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Keep businesses whose name contains one of these words (`srl`, `studio`).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude names containing",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Skip businesses whose name contains one of these words (`mcdonald`, `franchising`).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "New businesses only",
            "type": "boolean",
            "description": "Skip (and do not charge) the businesses that a previous run with the same *Memory key* already delivered. Schedule the same input every week to receive only the businesses added since. The memory lives in the named key-value store `paginegialle-businesses-scraper-seen` of your account.",
            "default": false
          },
          "stateKey": {
            "title": "Memory key",
            "pattern": "^[a-zA-Z0-9_-]+$",
            "maxLength": 64,
            "type": "string",
            "description": "Name of the memory used by *New businesses only* (letters, digits, `_`, `-`). Give each schedule its own key, e.g. `dentisti-roma`.",
            "default": "default"
          },
          "resetState": {
            "title": "Reset the memory",
            "type": "boolean",
            "description": "Forget the businesses remembered under *Memory key* before this run (it then returns everything again).",
            "default": false
          },
          "excludeEmptyFields": {
            "title": "Drop empty fields",
            "type": "boolean",
            "description": "Remove null values, empty texts, empty lists and empty objects from every business: a compact JSON, smaller exports. Off: every business has all the fields (stable CSV columns).",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy or your own proxies, for the Pagine Gialle pages (company websites visited by *Find e-mails* are read directly). Keep the default: it is included in the price. The residential Apify proxy is not available in this Actor."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many pages the Actor reads at the same time. Default: 4.",
            "default": 4
          },
          "maxRequestsPerMinute": {
            "title": "Max requests per minute",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Upper limit on the Actor's request rate. Default: 120; lower it to run more slowly.",
            "default": 120
          },
          "maxRequestRetries": {
            "title": "Max request retries",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Retries per page when a request fails. Behind a proxy, a page the site turns away is also retried on a new proxy session up to 10 times without using up these retries. Default: 5.",
            "default": 5
          },
          "skipUnrecognizedLocation": {
            "title": "Skip searches whose place is not recognised",
            "type": "boolean",
            "description": "When the site does not recognise the *where* value it silently returns nationwide results. On (default): such searches are skipped with a warning instead of saving unrelated businesses.",
            "default": true
          },
          "debugLog": {
            "title": "Debug log",
            "type": "boolean",
            "description": "Verbose logging (one line per page and per skipped business).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}