{
  "openapi": "3.0.1",
  "info": {
    "title": "ThreeBestRated Scraper - Local Business Leads, Emails & Phones",
    "description": "Scrape ThreeBestRated.com curated Top-3 local businesses by category & US city: direct contact email, phone, website, full address, price range, services, year established & a lead score. Monitoring mode. No login, no API key, no browser.",
    "version": "0.1",
    "x-build-id": "wUT1R0mW21hocg1IT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~three-best-rated-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-three-best-rated-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/scrapesage~three-best-rated-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-three-best-rated-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/scrapesage~three-best-rated-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-three-best-rated-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "search",
              "startUrls"
            ],
            "type": "string",
            "description": "Search builds a list from categories × locations. Start URLs scrapes specific ThreeBestRated category or city-hub URLs you paste in.",
            "default": "search"
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Business categories to pull, as ThreeBestRated slugs or names — e.g. `dentists`, `roofing-contractors`, `web-designers`, `chiropractors`, `personal-injury-lawyers`, `real-estate-agents`, `hvac`, `accountants`. One per row. Leave EMPTY to scrape every category listed for each city. (Search mode.)",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "US cities to search, as \"City, ST\" — e.g. \"Houston, TX\", \"Chicago, IL\", \"Los Angeles, CA\". ThreeBestRated lists are city-based, so a city is required. One per row. (Search mode.)",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs (ThreeBestRated category or city URLs)",
            "type": "array",
            "description": "ThreeBestRated URLs to scrape directly: category pages (…/{category}-in-{city}-{st}, e.g. …/web-designers-in-chicago-il) or city hubs (…/local-businesses-in-{city}-{st}). Auto-detected and routed. One per row. (Start URLs mode.)",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results (businesses)",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Cap on business records across the whole run. Each category page yields up to 3 curated businesses.",
            "default": 100
          },
          "maxCategoriesPerCity": {
            "title": "Max categories per city",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "When scraping ALL categories for a city (no categories specified), cap how many categories to scrape per city. 0 = no cap (every category the city lists).",
            "default": 0
          },
          "enrichContactEmails": {
            "title": "Enrich contacts from the business's website",
            "type": "boolean",
            "description": "Opt-in extra lead enrichment: crawl each business's own website (home + contact/about) for additional emails, phones and social links. Only runs for businesses that list a website. ThreeBestRated already supplies a direct email on most listings, so leave this off for the cheapest runs. Note: when enabled, this is billed as a separate `contact_enrichment` event — once per business that actually gets enriched — in addition to the per-business charge.",
            "default": false
          },
          "withEmailOnly": {
            "title": "Only businesses with an email",
            "type": "boolean",
            "description": "Output only businesses that have a contact email (from ThreeBestRated or, if enabled, the website crawl).",
            "default": false
          },
          "withPhoneOnly": {
            "title": "Only businesses with a phone",
            "type": "boolean",
            "description": "Output only businesses that have a phone number.",
            "default": false
          },
          "withWebsiteOnly": {
            "title": "Only businesses with a website",
            "type": "boolean",
            "description": "Output only businesses that list their own website.",
            "default": false
          },
          "deduplicateBusinesses": {
            "title": "Deduplicate businesses",
            "type": "boolean",
            "description": "Skip a business already emitted in this run — useful when several searches overlap.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitoring mode — only new records",
            "type": "boolean",
            "description": "Remember what was already returned and emit ONLY businesses not seen in previous runs. Pairs with Apify Schedules to track new top-rated businesses over time. Does not conflict with the scheduler.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named key-value store that holds the 'already seen' ids for monitoring mode. Use a different name per tracked search to keep their histories separate.",
            "default": "threebestrated-monitor"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Maximum parallel page fetches. Lower it for very large runs if you see transient blocks; raise it for speed.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. ThreeBestRated works through the default Apify datacenter proxy (blocked requests retry automatically on a fresh IP). Switch to Residential for the most consistent results on very large runs.",
            "default": {
              "useApifyProxy": true
            }
          },
          "urlsFromFile": {
            "title": "Import URLs from a file",
            "type": "string",
            "description": "Paste a list of URLs (one per line), OR one link to a .txt/.csv file, Google Sheet or Google Drive file containing them. Lets you import many Start URLs at once instead of typing each. Google Sheet/Drive share links are handled automatically."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}