{
  "openapi": "3.0.1",
  "info": {
    "title": "Bluesky Account & Keyword Monitor",
    "description": "Watch Bluesky accounts and keywords on a schedule and get only posts you have not seen before. Cross-run memory, Discord and Slack alerts, digest mode. Account watching needs no credentials.",
    "version": "1.0",
    "x-build-id": "Ev1s6amMa7XVA0PJu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhzuhaib~bluesky-keyword-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhzuhaib-bluesky-keyword-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/muhzuhaib~bluesky-keyword-monitor/runs": {
      "post": {
        "operationId": "runs-sync-muhzuhaib-bluesky-keyword-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/muhzuhaib~bluesky-keyword-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-muhzuhaib-bluesky-keyword-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": {
          "watchlist": {
            "title": "Watchlist",
            "type": "array",
            "description": "What to watch. ACCOUNT watches deliver every new post by a handle and work with no credentials. KEYWORD watches use Bluesky search syntax (\"exact phrase\", from:handle, mentions:handle, -exclude, lang:en, has:media) and require a Bluesky handle and app password below, because Bluesky restricts anonymous search from datacentre networks.",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "keyword",
                    "account"
                  ],
                  "title": "Watch type",
                  "description": "Either \"keyword\" to watch a search query, or \"account\" to watch every new post by one handle."
                },
                "query": {
                  "type": "string",
                  "title": "Search query (keyword watches)",
                  "description": "The Bluesky search query for a keyword watch. Supports \"exact phrase\", from:handle, mentions:handle, -exclude, lang:en and has:media."
                },
                "handle": {
                  "type": "string",
                  "title": "Account handle (account watches)",
                  "description": "The account handle for an account watch, for example bsky.app."
                },
                "label": {
                  "type": "string",
                  "title": "Optional label shown in results and alerts",
                  "description": "An optional name for this watch, carried on every match so you can tell watches apart downstream."
                }
              }
            },
            "default": [
              {
                "type": "account",
                "handle": "nytimes.com",
                "label": "The New York Times"
              },
              {
                "type": "account",
                "handle": "npr.org",
                "label": "NPR"
              }
            ]
          },
          "blueskyHandle": {
            "title": "Bluesky handle (optional, recommended)",
            "type": "string",
            "description": "Your Bluesky handle, e.g. yourname.bsky.social. Providing it together with an app password raises API rate limits. Create the app password in Bluesky: Settings, Privacy and security, App passwords."
          },
          "blueskyAppPassword": {
            "title": "Bluesky app password (optional, recommended)",
            "type": "string",
            "description": "App password created in Bluesky settings. Use an app password, never your main password. Secret field."
          },
          "alerts": {
            "title": "Webhook alerts",
            "type": "object",
            "description": "Where to send new matches. Set a webhook URL and pick generic, Discord or Slack. Leave empty to write matches to the dataset only.",
            "properties": {
              "mode": {
                "title": "Alert mode",
                "type": "string",
                "enum": [
                  "none",
                  "per-batch",
                  "per-match"
                ],
                "description": "per-batch: one webhook POST per run with all new matches. per-match: one POST per new match. Each delivered POST is a billable alert-delivered event.",
                "prefill": "none"
              },
              "webhookUrl": {
                "title": "Webhook URL",
                "type": "string",
                "description": "Public https endpoint that receives the alert POST (Discord or Slack webhook URL, or your own receiver).",
                "editor": "textfield"
              },
              "format": {
                "title": "Payload format",
                "type": "string",
                "enum": [
                  "generic",
                  "discord",
                  "slack"
                ],
                "description": "discord and slack produce ready-to-post webhook payloads. generic posts a plain JSON object.",
                "prefill": "generic"
              }
            }
          },
          "digest": {
            "title": "Digest mode",
            "type": "boolean",
            "description": "Instead of one dataset item per match, write ONE summary item per run (matches listed inside it) and charge a single digest-delivered event. Cheapest way to poll frequently.",
            "default": false
          },
          "excludeReplies": {
            "title": "Exclude replies",
            "type": "boolean",
            "description": "Skip posts that are replies to other posts.",
            "default": true
          },
          "excludeReposts": {
            "title": "Exclude reposts",
            "type": "boolean",
            "description": "Skip repost entries in account feeds.",
            "default": true
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only deliver posts with at least this many likes (0 = all).",
            "default": 0
          },
          "languages": {
            "title": "Language filter",
            "type": "array",
            "description": "Only deliver posts tagged with these ISO 639-1 codes, e.g. en, de. Empty = all languages.",
            "default": []
          },
          "maxPostsPerWatch": {
            "title": "Max posts per watch per run",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Caps how many new posts one watch can deliver in a single run (and therefore the per-run cost).",
            "default": 100
          },
          "sinceMinutes": {
            "title": "Look-back window (minutes)",
            "minimum": 5,
            "type": "integer",
            "description": "Keyword searches only return posts newer than this window. Keep it a bit longer than your schedule interval.",
            "default": 1440
          },
          "debug": {
            "title": "Debug",
            "type": "boolean",
            "description": "Log per-watch API usage and cost-relevant counters.",
            "default": false
          },
          "stateStoreName": {
            "title": "Memory store name",
            "type": "string",
            "description": "The named key-value store holding which posts have already been delivered. Change it to keep separate watch lists apart, for example one per client. Leave it alone unless you need that.",
            "default": "bluesky-monitor-state"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}