{
  "openapi": "3.0.1",
  "info": {
    "title": "Dun & Bradstreet Company Data Scraper",
    "description": "Extracts company firmographics from the Dun & Bradstreet business directory: search by name, browse any NAICS industry by country, state and city, or pull full profiles with revenue, employees, key principals and corporate family. 120M+ businesses worldwide. HTTP-only, no login.",
    "version": "0.1",
    "x-build-id": "b8ZZt9NivlgBeDOej"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~dnb-companies-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-dnb-companies-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/scrapyx~dnb-companies-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-dnb-companies-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/scrapyx~dnb-companies-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-dnb-companies-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": "Mode",
            "enum": [
              "search",
              "industry",
              "profile",
              "industryAnalysis",
              "taxonomy"
            ],
            "type": "string",
            "description": "What to collect. 'search' finds companies by name. 'industry' browses every company in a NAICS industry (optionally narrowed to a state and city). 'profile' pulls the full firmographic record for specific companies. 'industryAnalysis' returns industry research. 'taxonomy' lists every valid industry path — run this first to discover the values the other modes need.",
            "default": "search"
          },
          "companyNames": {
            "title": "Company names",
            "type": "array",
            "description": "Company names to search for, one per row. Used by mode 'search'. Each name is queried independently and produces its own summary row.",
            "items": {
              "type": "string"
            }
          },
          "industryPaths": {
            "title": "Industry paths",
            "type": "array",
            "description": "NAICS industry paths such as 'retail_trade' or 'oil_and_gas_extraction'. Used by modes 'industry' and 'industryAnalysis'. Run the actor once in mode 'taxonomy' to list every valid value with its NAICS code.",
            "items": {
              "type": "string"
            }
          },
          "companyUrls": {
            "title": "Company profile URLs or selectors",
            "type": "array",
            "description": "Used by mode 'profile'. Accepts a full D&B profile URL (https://www.dnb.com/business-directory/company-profiles.apple_inc.ec7f550b3a97b94d919d837672573959.html) or just the bare selector after 'company-profiles.'.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country (ISO alpha-2)",
            "type": "string",
            "description": "Two-letter country code, e.g. 'us', 'gb', 'de', 'in', 'br', 'id'. Defaults to 'us' for industry browsing. D&B returns zero rows for a code it does not carry rather than an error, so a typo looks like an empty result.",
            "default": "us"
          },
          "regionName": {
            "title": "State / region",
            "type": "string",
            "description": "Optional state or region slug for mode 'industry', e.g. 'california' or 'new_york'. Read valid values from the companyInformationGeos hrefs in a broader run's output."
          },
          "cityName": {
            "title": "City",
            "type": "string",
            "description": "Optional city slug for mode 'industry', e.g. 'los_angeles'. Works on its own or combined with a state/region — both narrow to the same result set."
          },
          "minEmployees": {
            "title": "Minimum employees",
            "minimum": 0,
            "type": "integer",
            "description": "Lower bound on employee count for mode 'search'. Verified to move the match count (an 'apple' search drops from 20,195 to 34 with a 1,000-100,000 range)."
          },
          "maxEmployees": {
            "title": "Maximum employees",
            "minimum": 0,
            "type": "integer",
            "description": "Upper bound on employee count for mode 'search'."
          },
          "enrichWithProfile": {
            "title": "Fetch full profile for every company",
            "type": "boolean",
            "description": "For modes 'search' and 'industry': fetch each company's complete firmographic profile (revenue, employees, key principal, financial history, corporate family, competitors). Costs one extra request per company, so leave it off for large listing runs.",
            "default": false
          },
          "maxItems": {
            "title": "Max companies per query",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many companies per input. Set 0 for no cap. Note that D&B itself only pages through about 1,000 companies per query however high this is set.",
            "default": 100
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Results per request for mode 'search'. Maximum 50 — D&B returns zero rows for anything larger. Does not apply to mode 'industry', where the page size is fixed at 50 server-side.",
            "default": 50
          },
          "language": {
            "title": "Language code",
            "type": "string",
            "description": "Language for D&B's own labels and descriptions, e.g. 'en' or 'de'. Does not change which companies match.",
            "default": "en"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Upper bound on requests in flight across all queries. Pagination within one query is always sequential because the stop condition depends on the previous page.",
            "default": 4
          },
          "minRequestInterval": {
            "title": "Min seconds between requests",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Paces how often a request may START, without occupying a concurrency slot. This, not maxConcurrency, is the honest speed control once the rate cap binds. Raise it if Cloudflare starts challenging.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy settings. Residential is the default on the platform: the API is fronted by Cloudflare, and a datacenter exit raises the challenge rate. Local runs go direct unless this is set.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}