{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Company Data Extractor: Firmographics + Social Signals",
    "description": "Scrapes public LinkedIn company pages. Live-saves results per URL. Starts with user-selected proxy (or direct), falls back to Apify Residential if blocked, and keeps it.",
    "version": "0.2",
    "x-build-id": "G9JB1LKwXyvh06du8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapium~linkedin-company-profile-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapium-linkedin-company-profile-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/scrapium~linkedin-company-profile-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapium-linkedin-company-profile-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/scrapium~linkedin-company-profile-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapium-linkedin-company-profile-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": [
          "companyUrls"
        ],
        "properties": {
          "companyUrls": {
            "title": "🔗 Company page URLs (required)",
            "minItems": 1,
            "type": "array",
            "description": "📌 List of public LinkedIn company page URLs to process (for example: https://www.linkedin.com/company/netflix). Each URL is scraped independently and saved to the dataset as soon as it finishes. Add one or many URLs; duplicates are automatically skipped and large batches are handled efficiently via a Request Queue.",
            "items": {
              "type": "string"
            }
          },
          "scrapeMode": {
            "title": "🧭 Scrape mode",
            "enum": [
              "essentials",
              "complete"
            ],
            "type": "string",
            "description": "⚡ 'Essentials' pulls only firmographics + follower count for a leaner, cheaper, faster output. 'Complete' additionally extracts employee previews, related companies, and recent posts.",
            "default": "complete"
          },
          "includeEngagementMetrics": {
            "title": "📊 Include post engagement metrics",
            "type": "boolean",
            "description": "❤️ When scrape mode is 'complete', attach like/comment/share counts to each extracted post (when LinkedIn exposes them). Ignored in 'essentials' mode since posts aren't fetched.",
            "default": true
          },
          "maxPostsPerCompany": {
            "title": "📰 Max posts per company",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "🔢 Maximum number of recent posts to keep per company page (only applies in 'complete' mode). LinkedIn's public page typically exposes a limited recent set.",
            "default": 10
          },
          "flattenListFields": {
            "title": "📄 Flatten list fields for spreadsheets",
            "type": "boolean",
            "description": "🧾 When enabled, list/object fields (location, specialties, related companies, employee preview, posts) are converted into single semicolon-separated text fields — ideal for clean CSV/Excel exports. When disabled (default), these stay as structured JSON arrays/objects for programmatic use.",
            "default": false
          },
          "politeDelayMs": {
            "title": "⏱️ Polite delay between requests (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "🐢 Optional delay (with randomized jitter) applied before each request to space out traffic and reduce block risk on large batches. 0 disables the delay.",
            "default": 0
          },
          "retryLimit": {
            "title": "🔁 Retry limit per URL",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "🔂 Maximum number of attempts per company URL before giving up and saving an error row.",
            "default": 3
          },
          "requestTimeoutSeconds": {
            "title": "⏳ Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "⌛ Per-request timeout in seconds before an attempt is considered failed and retried.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "🧵 Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "⚙️ Number of company URLs processed in parallel. Higher values finish faster but increase block risk and proxy usage.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "🛡️ Optional. Start with this proxy for requests. If LinkedIn blocks or rejects (e.g. 403, 407, 429, 999 or authwall redirects), the actor switches to Apify Residential and keeps using it for the rest of the run. Leave empty to start direct (no proxy)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}