{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkedIn Post Scraper By Keyword",
    "description": "Scrapes posts from any public LinkedIn profile or company page, capturing text, images, videos, authors, timestamps, reactions, comments, hashtags, and post URLs. Ideal for content research, competitor tracking, engagement analysis, and large-scale LinkedIn data extraction",
    "version": "0.1",
    "x-build-id": "7193hlGUeooieag0h"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~linkedin-post-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-linkedin-post-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/scrapio~linkedin-post-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-linkedin-post-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/scrapio~linkedin-post-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-linkedin-post-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": {
          "postSources": {
            "title": "🔗 Post sources (URLs)",
            "type": "array",
            "description": "LinkedIn company, profile or post-permalink URLs to monitor — one per line. Runs fully logged-out (no cookies). Single post-permalink pages are the most reliable source; company/profile feeds may be partially login-walled. Base key `urls` is also accepted.",
            "items": {
              "type": "string"
            }
          },
          "postsPerSource": {
            "title": "📊 Posts per source",
            "minimum": 1,
            "type": "integer",
            "description": "How many posts to collect from each source. Example: postsPerSource=25 pulls up to 25 posts per URL. Default is 10. Base key `limitPerSource` is also accepted.",
            "default": 10
          },
          "keywords": {
            "title": "🏷️ Keywords / brand terms",
            "type": "array",
            "description": "Case-insensitive terms to match in the post body and its hashtags. Example: [\"acme\", \"our product\", \"#launch\"] matches each term in the text and lists the hits in matchedTerms[]. Empty = no matching (all posts pass unless a filter is on).",
            "items": {
              "type": "string"
            }
          },
          "hashtagsToMatch": {
            "title": "#️⃣ Hashtags to watch",
            "type": "array",
            "description": "Specific hashtags to flag (with or without '#'). Example: [\"#hiring\", \"ai\"] surfaces present hits in matchedHashtags[]. All hashtags found in a post are always emitted in hashtags[] regardless.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "🚫 Exclude keywords",
            "type": "array",
            "description": "Drop any post whose text/hashtags contain one of these terms (case-insensitive). Example: [\"webinar\", \"giveaway\"].",
            "items": {
              "type": "string"
            }
          },
          "onlyMatchingPosts": {
            "title": "✅ Only output matching posts",
            "type": "boolean",
            "description": "When ON and at least one keyword/hashtag is set, only posts that matched are written to the output table. Default OFF (every post is written, matched or not).",
            "default": false
          },
          "trackNewPosts": {
            "title": "🔁 Track new posts across runs",
            "type": "boolean",
            "description": "Enable cross-run change detection. Run 1 seeds the store (newSinceLastRun=null). From run 2 onward, first-seen posts are newSinceLastRun=true. Default ON.",
            "default": true
          },
          "trackingStoreName": {
            "title": "🗃️ Tracking store name",
            "type": "string",
            "description": "Name of the persistent (named) key-value store that remembers seen post activityIds between runs. Keep the SAME name across runs of one watchlist so changes accumulate. A different name = a fresh baseline.",
            "default": "linkedin-keyword-monitor-state"
          },
          "onlyNewPosts": {
            "title": "🆕 Only output new posts",
            "type": "boolean",
            "description": "When ON, only posts flagged newSinceLastRun=true are written to the output table (requires tracking ON and a prior baseline run). Default OFF.",
            "default": false
          },
          "publishedAfter": {
            "title": "📅 Published after",
            "type": "string",
            "description": "Only include posts published on/after this date. Base key `scrapeUntil` is also accepted."
          },
          "deepCrawl": {
            "title": "🔍 Deep crawl the post graph",
            "type": "boolean",
            "description": "Follow the post-URN graph (BFS) to gather more posts per source instead of only the first page. Recommended. Base key `deepScrape` is also accepted.",
            "default": true
          },
          "includeRawHtml": {
            "title": "📦 Include raw HTML (advanced)",
            "type": "boolean",
            "description": "Attach the raw source HTML to each row for debugging. Off for cleaner output. Base key `rawData` is also accepted.",
            "default": false
          },
          "aiSentiment": {
            "title": "🤖 Analyze post sentiment",
            "type": "boolean",
            "description": "When ON and an API key is supplied, adds postSentiment to each row. Default OFF.",
            "default": false
          },
          "aiModel": {
            "title": "🤖 AI model / provider",
            "enum": [
              "claude-haiku-4-5",
              "claude-sonnet-5",
              "claude-opus-4-8",
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1-mini",
              "o3-mini"
            ],
            "type": "string",
            "description": "Provider auto-detected from the name: claude-*=Anthropic, gpt-*/o1/o3=OpenAI. Cheaper models are recommended for classification.",
            "default": "claude-haiku-4-5"
          },
          "aiApiKey": {
            "title": "🔑 AI API key",
            "type": "string",
            "description": "API key for the selected provider. Falls back to the ANTHROPIC_API_KEY / OPENAI_API_KEY environment variable. Kept private to your run."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy configuration",
            "type": "object",
            "description": "Optional proxy for reliability and to avoid rate limits."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}