{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Posts Scraper",
    "description": "Scrape public LinkedIn posts from keyword searches, company feeds or exact post URLs. Each post has text, author, likes, comments, media and a comments preview. Works with Apify MCP and the API.",
    "version": "0.1",
    "x-build-id": "fRsLwzYK8HO9aKnrp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~linkedin-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-linkedin-posts-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/khadinakbar~linkedin-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-linkedin-posts-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/khadinakbar~linkedin-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-linkedin-posts-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",
        "properties": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords or phrases to search in public LinkedIn posts, for example ai agents or open source CRM. Uses Google-indexed public LinkedIn results via the primary managed public-data route. Defaults to an empty list. Not for private LinkedIn feeds or logged-in-only posts.",
            "items": {
              "type": "string"
            }
          },
          "companyUrls": {
            "title": "Company page URLs",
            "type": "array",
            "description": "Public LinkedIn company pages whose recent posts should be scraped, for example https://www.linkedin.com/company/shopify. Accepts one URL per line. Defaults to an empty list. Not for personal profile URLs.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Exact post URLs",
            "type": "array",
            "description": "Exact public LinkedIn post, feed update, or article URLs to fetch, for example https://www.linkedin.com/posts/example_activity-7354600338621906944. Defaults to an empty list. Invalid or non-post LinkedIn URLs are skipped.",
            "items": {
              "type": "string"
            }
          },
          "maxPosts": {
            "title": "Maximum posts",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of post records to save across all sources. This is the hard cap for billable post-scraped events. Default is 100. Use lower values for canaries or agent calls. Free Apify plan runs return up to 25 results per run.",
            "default": 100
          },
          "datePosted": {
            "title": "Search date filter",
            "enum": [
              "any",
              "last-hour",
              "last-day",
              "last-week",
              "last-month",
              "last-year"
            ],
            "type": "string",
            "description": "Freshness window for keyword search results (last-hour, last-day, last-week, last-month or last-year). Default is last-month. Does not filter company feeds or exact post URLs. For an exact cut-off use Posted after or Max post age (days) below.",
            "default": "last-month"
          },
          "postedAfter": {
            "title": "Posted after (date)",
            "maxLength": 40,
            "type": "string",
            "description": "Only keep posts published on or after this date, for example 2026-11-01. Applied to search, company and URL rows; posts older than this are dropped and not billed. Leave empty for no cut-off. Posts without a publish date are dropped when this is set."
          },
          "maxAgeDays": {
            "title": "Max post age (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Only keep posts published within the last N days, for example 7. Applied to search, company and URL rows; older posts are dropped and not billed. Default is 0 (no limit). If you also set Posted after, the stricter cut-off wins.",
            "default": 0
          },
          "minReactions": {
            "title": "Min reactions",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep posts with at least this many reactions (likes), for example 100. Posts below it are dropped and not billed, so this finds high-engagement posts at no extra cost. Default is 0 (no minimum).",
            "default": 0
          },
          "minComments": {
            "title": "Min comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep posts with at least this many comments, for example 10. Posts below it are dropped and not billed. Default is 0 (no minimum).",
            "default": 0
          },
          "maxSearchPages": {
            "title": "Maximum search pages",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Advanced cap for the primary managed public-data route search pagination. Default is 5 pages and maximum is 60. Lower it when testing cursor behavior. Not used for company URLs or exact post URLs.",
            "default": 5
          },
          "maxPagesPerCompany": {
            "title": "Maximum pages per company",
            "minimum": 1,
            "maximum": 7,
            "type": "integer",
            "description": "How many provider pages to fetch for each LinkedIn company URL. Default is 2 and maximum is 7 because public company-post coverage is shallow. the managed fallback route company fallback only returns one page. Not used for search queries.",
            "default": 2
          },
          "startCursor": {
            "title": "Start cursor",
            "maxLength": 200,
            "type": "string",
            "description": "Optional the primary managed public-data route cursor from a previous keyword-search run. Paste the cursor when continuing a search. Leave empty for a fresh search. Not used for company feeds or exact post URLs."
          },
          "enrichPostDetails": {
            "title": "Enrich post details",
            "type": "boolean",
            "description": "Fetch each post's full detail (fuller text, media, comments preview) with one extra lookup per post. Default is off because search and company results already include author, likes and comments. Rows fetched this way are billed as the higher-priced full-detail post event. Exact post URLs are always full-detail.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments preview",
            "type": "boolean",
            "description": "Include up to five public comments returned inside each post detail payload. Default is false to keep records compact for agents. This is a preview only, not exhaustive comment scraping. Use the comments actor for full comment rows.",
            "default": false
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "full",
              "compact"
            ],
            "type": "string",
            "description": "Compact mode keeps the main fields for MCP and tables. Full mode also includes image lists, company extras, author images, and richer provenance. Default is full. Raw provider payloads still require includeRawData.",
            "default": "full"
          },
          "includeRawData": {
            "title": "Include raw response data",
            "type": "boolean",
            "description": "Attach raw provider payloads to each dataset item. Default is false because raw payloads are large and less useful for agents. Enable only for debugging or custom downstream parsing. Does not expose provider API keys.",
            "default": false
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}