{
  "openapi": "3.0.1",
  "info": {
    "title": "B2B Agency Scraper - Marketing, Design & Dev Agency Leads",
    "description": "Scrape B2B agencies from Sortlist & DesignRush: name, services, ratings, pricing, team size, location, socials & website contact emails. Marketing, SEO, design, web, app & software agencies — the clean Clutch alternative. Filter by category, score leads & monitor new agencies.",
    "version": "0.1",
    "x-build-id": "tuIZGJPAhnKuoTzck"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~b2b-agency-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-b2b-agency-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~b2b-agency-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-b2b-agency-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~b2b-agency-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-b2b-agency-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": [
          "serviceCategories"
        ],
        "properties": {
          "serviceCategories": {
            "title": "Service categories",
            "type": "array",
            "description": "Agency service categories to scrape, combined with every source. Use a friendly key (digital-marketing, seo, ppc, social-media-marketing, content-marketing, email-marketing, public-relations, advertising, branding, web-design, web-development, ecommerce, software-development, mobile-app-development, ui-ux-design, video-production, graphic-design, it-services, ai, cybersecurity) or paste any raw Sortlist/DesignRush category slug. Unknown slugs are tried as-is and skipped if the source has no such category.",
            "default": [
              "digital-marketing"
            ],
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "title": "Directories",
            "type": "array",
            "description": "Which B2B agency directories to scrape. Both are clean, no-browser SSR sources; together they give the widest, deduplicated coverage.",
            "items": {
              "type": "string",
              "enum": [
                "sortlist",
                "designrush"
              ],
              "enumTitles": [
                "Sortlist",
                "DesignRush"
              ]
            },
            "default": [
              "sortlist",
              "designrush"
            ]
          },
          "locations": {
            "title": "Locations (DesignRush only)",
            "type": "array",
            "description": "Optional geo filter applied to DesignRush listings as a URL suffix, e.g. \"us\", \"us-new-york\", \"united-kingdom\". Sortlist listings are global per category (use startUrls for a specific Sortlist geo page).",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Paste any Sortlist or DesignRush listing or agency-profile URL. Profile URLs are scraped directly; listing URLs are paginated.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max agencies",
            "minimum": 1,
            "type": "integer",
            "description": "Total agency records to emit across all categories, sources and pages.",
            "default": 100
          },
          "maxPagesPerSource": {
            "title": "Max listing pages per source/category",
            "minimum": 1,
            "maximum": 45,
            "type": "integer",
            "description": "How many listing pages to walk per source per category (each Sortlist page ≈ 20-23 agencies; DesignRush ≈ 50). Sortlist supports deep pagination (up to ~45 pages).",
            "default": 3
          },
          "includeProfileDetails": {
            "title": "Include profile details (agency website + richer fields)",
            "type": "boolean",
            "description": "Fetch each agency's profile page to capture the agency's own website (the email wedge), team size, full address and extra socials. Turn off for a faster, listing-only run.",
            "default": true
          },
          "includeReviews": {
            "title": "Include client reviews",
            "type": "boolean",
            "description": "Emit one extra record per client review (rating, author, date, body) found on the agency profile page.",
            "default": false
          },
          "maxReviewsPerAgency": {
            "title": "Max reviews per agency",
            "minimum": 1,
            "type": "integer",
            "description": "Cap reviews emitted per agency when 'Include client reviews' is on.",
            "default": 10
          },
          "enrichContactEmails": {
            "title": "Enrich contact emails (crawl agency website)",
            "type": "boolean",
            "description": "For each agency with a website, crawl its home + contact/about pages for public contact emails, phone numbers and extra social links — the B2B lead wedge. Directories don't publish agency emails; this is the only way to get them.",
            "default": false
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only keep agencies with at least this star rating (0-5). 0 = no filter.",
            "default": 0
          },
          "minReviews": {
            "title": "Minimum review count",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep agencies with at least this many client reviews. 0 = no filter.",
            "default": 0
          },
          "withWebsiteOnly": {
            "title": "Only agencies with a website",
            "type": "boolean",
            "description": "Drop agencies whose own website couldn't be resolved (requires profile details).",
            "default": false
          },
          "withEmailOnly": {
            "title": "Only agencies with an email",
            "type": "boolean",
            "description": "Drop agencies with no contact email (requires 'Enrich contact emails').",
            "default": false
          },
          "deduplicateAgencies": {
            "title": "Deduplicate agencies",
            "type": "boolean",
            "description": "Collapse the same agency appearing on multiple sources / pages into one record (by website domain or name).",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new agencies)",
            "type": "boolean",
            "description": "Remember agencies returned in previous runs (in a named key-value store) and emit only NEW ones on each run. Pair with Apify Schedules for a daily fresh-agency feed — it does not conflict with the scheduler.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named key-value store used by monitor mode. Use distinct names to track different searches independently.",
            "default": "b2b-agency-monitor"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Parallel requests. Lower it if you hit rate limits.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Defaults to Apify US datacenter proxies, which both sources serve cleanly.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}