{
  "openapi": "3.0.1",
  "info": {
    "title": "Beehiiv Directory, Profile & Post Extractor",
    "description": "Browse Beehiiv's newsletter directory by category, fetch a newsletter's profile by URL or subdomain, or pull its recent posts with titles, authors and dates.",
    "version": "1.1",
    "x-build-id": "XizFcx1Nx5iVFixNu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dataspryva~beehiiv-directory-profile-and-post-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dataspryva-beehiiv-directory-profile-and-post-extractor",
        "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/dataspryva~beehiiv-directory-profile-and-post-extractor/runs": {
      "post": {
        "operationId": "runs-sync-dataspryva-beehiiv-directory-profile-and-post-extractor",
        "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/dataspryva~beehiiv-directory-profile-and-post-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-dataspryva-beehiiv-directory-profile-and-post-extractor",
        "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": [
              "discover",
              "getNewsletter",
              "searchPosts",
              "getPost"
            ],
            "type": "string",
            "description": "What to collect from Beehiiv.",
            "default": "discover"
          },
          "startUrls": {
            "title": "Newsletter or post URLs",
            "type": "array",
            "description": "Newsletter homepages (e.g. https://aibreakfast.beehiiv.com or https://www.therundown.ai) for getNewsletter/searchPosts, or direct post URLs (…/p/slug) for getPost.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subdomains": {
            "title": "Beehiiv subdomains",
            "type": "array",
            "description": "Bare Beehiiv subdomains such as aibreakfast or tldr. They are resolved to https://<subdomain>.beehiiv.com. Custom domains belong in startUrls.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Directory keyword",
            "type": "string",
            "description": "Keyword matched against newsletter name and listing text in the Beehiiv directory (mode=discover).",
            "default": ""
          },
          "category": {
            "title": "Directory category",
            "enum": [
              "",
              "AI",
              "Cloud & DevOps",
              "Cybersecurity",
              "Data & Analytics",
              "Design",
              "Development",
              "Entrepreneurship",
              "Indiehacking",
              "Marketing",
              "No-Code & Automation",
              "Product Management",
              "SaaS",
              "Sales",
              "Startups",
              "Tech News",
              "Venture Capital"
            ],
            "type": "string",
            "description": "Topic filter for the directory (mode=discover). Leave empty for every topic.",
            "default": ""
          },
          "frequency": {
            "title": "Publishing frequency",
            "enum": [
              "",
              "daily",
              "weekly",
              "2-3x-week"
            ],
            "type": "string",
            "description": "Directory filter for newsletters with a published cadence (mode=discover). Frequency is known for a subset of listings.",
            "default": ""
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "popular",
              "newest",
              "featured",
              "trending",
              "alpha"
            ],
            "type": "string",
            "description": "How to order directory results (mode=discover).",
            "default": "popular"
          },
          "postSearchQuery": {
            "title": "Post keyword",
            "type": "string",
            "description": "Only keep posts whose title or excerpt contains this keyword (mode=searchPosts). Uses the newsletter archive search when available.",
            "default": ""
          },
          "dateFrom": {
            "title": "Published after",
            "type": "string",
            "description": "Only keep posts published on or after this date (YYYY-MM-DD). Leave empty for no lower bound.",
            "default": ""
          },
          "dateTo": {
            "title": "Published before",
            "type": "string",
            "description": "Only keep posts published on or before this date (YYYY-MM-DD). Leave empty for no upper bound.",
            "default": ""
          },
          "maxItems": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum total records to save (newsletters or posts).",
            "default": 20
          },
          "maxPostsPerNewsletter": {
            "title": "Max posts per newsletter",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on posts collected from each newsletter (mode=searchPosts).",
            "default": 10
          },
          "includeContent": {
            "title": "Include full post text",
            "type": "boolean",
            "description": "Fetch each post page and add its public article text (mode=searchPosts/getPost). Slower and uses more requests; paywalled bodies are never bypassed.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}