{
  "openapi": "3.0.1",
  "info": {
    "title": "Bluesky Monitor — Hashtags, Profiles & Webhooks",
    "description": "Watch Bluesky hashtags live, pull profile feeds, and get webhook alerts for only-new posts. Built on Jetstream for cloud-friendly monitoring — schedule it, don’t babysit it.",
    "version": "0.1",
    "x-build-id": "hgIFISQywnyk3Q0Zd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/abaddon~bluesky-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-abaddon-bluesky-monitor",
        "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/abaddon~bluesky-monitor/runs": {
      "post": {
        "operationId": "runs-sync-abaddon-bluesky-monitor",
        "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/abaddon~bluesky-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-abaddon-bluesky-monitor",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "hashtag",
              "profile",
              "monitor",
              "search"
            ],
            "type": "string",
            "description": "hashtag (recommended) = live Jetstream; profile = user feeds; monitor = only-new via Schedule; search = EXPERIMENTAL/BROKEN from Apify cloud (AppView 403) — requires forceAppViewSearch.",
            "default": "hashtag"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword string for search mode only (usually broken from cloud). Prefer hashtags[] for hashtag mode."
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags to watch (with or without #). Live Jetstream matches facets + #word boundaries. Short tags (≤2 chars) require facet or strict #tag (e.g. #ai will not match inside \"said\").",
            "items": {
              "type": "string"
            }
          },
          "handles": {
            "title": "Profile handles",
            "type": "array",
            "description": "Bluesky handles to watch (with or without @), e.g. jay.bsky.team",
            "items": {
              "type": "string"
            }
          },
          "monitorSource": {
            "title": "Monitor source",
            "enum": [
              "hashtag",
              "profile",
              "search"
            ],
            "type": "string",
            "description": "When mode is monitor: which source to watch. hashtag uses live Jetstream. search requires forceAppViewSearch.",
            "default": "hashtag"
          },
          "monitorEnabled": {
            "title": "Only new posts",
            "type": "boolean",
            "description": "If true (default when mode=monitor), dedupe against prior runs and emit only new posts.",
            "default": false
          },
          "baselineOnly": {
            "title": "Baseline only (first run)",
            "type": "boolean",
            "description": "On the first monitor run, record seen posts but emit nothing. Next scheduled run only gets truly new posts.",
            "default": false
          },
          "maxItems": {
            "title": "Max posts",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum posts to collect this run. For Jetstream hashtag: stop after this many matches (or when jetstreamMaxSeconds elapses).",
            "default": 10
          },
          "useJetstream": {
            "title": "Use Jetstream (hashtag)",
            "type": "boolean",
            "description": "For hashtag mode: listen on public Bluesky Jetstream (live-only, no history). Default true. Setting false requires forceAppViewSearch and usually fails with 403.",
            "default": true
          },
          "jetstreamMaxSeconds": {
            "title": "Jetstream max seconds",
            "minimum": 5,
            "maximum": 3600,
            "type": "integer",
            "description": "How long to listen on Jetstream for matching hashtags. Actors bill CU while listening. Default 90s. Use Apify Schedule for ongoing monitors instead of very long windows.",
            "default": 90
          },
          "jetstreamRegion": {
            "title": "Jetstream region",
            "enum": [
              "us-east",
              "us-west",
              "v1-us-east",
              "v1-us-west"
            ],
            "type": "string",
            "description": "Preferred Jetstream region. On connect failure the Actor fails over to other public regions / v1 endpoints (unless jetstreamUrl is set).",
            "default": "us-east"
          },
          "jetstreamUrl": {
            "title": "Jetstream URL override",
            "type": "string",
            "description": "Optional full WebSocket base URL. Forces a single host (disables region failover)."
          },
          "jetstreamLookbackSeconds": {
            "title": "Jetstream lookback seconds",
            "minimum": 0,
            "maximum": 3600,
            "type": "integer",
            "description": "On connect, resume from this many seconds ago via Jetstream live cursor (unix µs). Speeds up hashtag matches using the free lookback window — not the metered archive API. Default 120. Set 0 for live-tail only.",
            "default": 120
          },
          "forceAppViewSearch": {
            "title": "Force AppView keyword search (advanced)",
            "type": "boolean",
            "description": "HIDDEN/ADVANCED. Keyword search via AppView is unreliable from Apify (HTTP 403). Leave false. Only set true if you accept likely failure / are debugging.",
            "default": false
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "latest",
              "top"
            ],
            "type": "string",
            "description": "AppView search sort (only with forceAppViewSearch). Ignored for Jetstream.",
            "default": "latest"
          },
          "lang": {
            "title": "Language",
            "type": "string",
            "description": "Optional BCP47 language filter for AppView search (e.g. en). Not applied on Jetstream."
          },
          "includeReplies": {
            "title": "Include replies (profile)",
            "type": "boolean",
            "description": "For profile mode, include reply posts.",
            "default": false
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Drop posts with fewer likes than this. Live Jetstream posts usually have 0 likes at create time.",
            "default": 0
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional HTTPS endpoint. New posts are POSTed as JSON after the run. Failures are logged; the run still SUCCEEDS with dataset data."
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Optional named KV store for watermarks (use different names for parallel watches)."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Used for AppView profile/search only — Jetstream does not use Apify proxy. Search often 403 even with residential.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}