{
  "openapi": "3.0.0",
  "info": {
    "title": "Collect LinkedIn Companies by URL",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.brightdata.com"
    }
  ],
  "paths": {
    "/datasets/v3/scrape": {
      "post": {
        "summary": "Collect LinkedIn Companies by URL",
        "description": "Collect structured LinkedIn company data by URL using the Bright Data Web Scraper API with dataset ID gd_l1vikfnt1wgvvqz95w for company profiles and metadata.",
        "parameters": [
          {
            "in": "query",
            "name": "dataset_id",
            "required": true,
            "schema": {
              "type": "string",
              "default": "gd_l1vikfnt1wgvvqz95w"
            },
            "description": "Must be `gd_l1vikfnt1wgvvqz95w` for this dataset."
          },
          {
            "in": "query",
            "name": "notify",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Send notifications when the request is completed."
          },
          {
            "in": "query",
            "name": "include_errors",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true
            },
            "description": "Include errors in the response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "array",
                    "description": "Array of input objects. See `Request Body` below for the supported fields.",
                    "items": {
                      "type": "object",
                      "required": [
                        "url"
                      ],
                      "properties": {
                        "url": {
                          "type": "string",
                          "example": "https://www.linkedin.com/company/bright-data"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK. See response example below the parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl --request POST \\\n  --url 'https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1vikfnt1wgvvqz95w&include_errors=true' \\\n  --header \"Authorization: Bearer YOUR_API_KEY\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\"input\": [{\"url\": \"https://www.linkedin.com/company/bright-data\"}]}'"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import requests\n\nurl = \"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1vikfnt1wgvvqz95w&include_errors=true\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\",\n}\npayload = {\n    \"input\": [\n        {\n            \"url\": \"https://www.linkedin.com/company/bright-data\"\n        }\n    ]\n}\n\nresponse = requests.post(url, headers=headers, json=payload)\nprint(response.text)"
          },
          {
            "lang": "py",
            "label": "Python SDK",
            "source": "# Install: pip install brightdata-sdk\nfrom brightdata import BrightDataClient\n\nasync with BrightDataClient(api_key=\"YOUR_API_KEY\") as client:\n    result = await client.scrape.linkedin.companies(url=\"https://www.linkedin.com/company/bright-data\")\n    print(result.data)"
          },
          {
            "lang": "javascript",
            "label": "JavaScript",
            "source": "const response = await fetch(\"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1vikfnt1wgvvqz95w&include_errors=true\", {\n  method: \"POST\",\n  headers: {\n    \"Authorization\": \"Bearer YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({\n    \"input\": [\n        {\n            \"url\": \"https://www.linkedin.com/company/bright-data\"\n        }\n    ]\n}),\n});\n\nconst data = await response.text();\nconsole.log(data);"
          },
          {
            "lang": "js",
            "label": "JavaScript SDK",
            "source": "// Install: npm install @brightdata/sdk\nimport { bdclient } from '@brightdata/sdk';\n\nconst client = new bdclient({ apiKey: 'YOUR_API_KEY' });\n\nconst result = await client.scrape.linkedin.collectCompanies(['https://www.linkedin.com/company/bright-data']);\nconsole.log(result);\n\nawait client.close();"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n$ch = curl_init(\"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1vikfnt1wgvvqz95w&include_errors=true\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n    \"Authorization: Bearer YOUR_API_KEY\",\n    \"Content-Type: application/json\",\n]);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([\n    \"input\" => [\n        [\n            \"url\" => \"https://www.linkedin.com/company/bright-data\"\n        ]\n    ]\n]));\n\n$response = curl_exec($ch);\ncurl_close($ch);\necho $response;"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tpayload := []byte(\"{\\\"input\\\": [{\\\"url\\\": \\\"https://www.linkedin.com/company/bright-data\\\"}]}\")\n\treq, _ := http.NewRequest(\"POST\", \"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1vikfnt1wgvvqz95w&include_errors=true\", bytes.NewBuffer(payload))\n\treq.Header.Set(\"Authorization\", \"Bearer YOUR_API_KEY\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil { panic(err) }\n\tdefer res.Body.Close()\n\n\tbody, _ := io.ReadAll(res.Body)\n\tfmt.Println(string(body))\n}"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class Main {\n    public static void main(String[] args) throws Exception {\n        String body = \"{\\\"input\\\": [{\\\"url\\\": \\\"https://www.linkedin.com/company/bright-data\\\"}]}\";\n        HttpRequest request = HttpRequest.newBuilder()\n            .uri(URI.create(\"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1vikfnt1wgvvqz95w&include_errors=true\"))\n            .header(\"Authorization\", \"Bearer YOUR_API_KEY\")\n            .header(\"Content-Type\", \"application/json\")\n            .method(\"POST\", HttpRequest.BodyPublishers.ofString(body))\n            .build();\n\n        HttpResponse<String> response = HttpClient.newHttpClient()\n            .send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require 'net/http'\nrequire 'json'\nrequire 'uri'\n\nuri = URI.parse(\"https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_l1vikfnt1wgvvqz95w&include_errors=true\")\nrequest = Net::HTTP::Post.new(uri)\nrequest[\"Authorization\"] = \"Bearer YOUR_API_KEY\"\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = {\"input\": [{\"url\": \"https://www.linkedin.com/company/bright-data\"}]}.to_json\n\nresponse = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }\nputs response.body"
          }
        ]
      }
    }
  }
}
