{
  "openapi": "3.0.1",
  "info": {
    "title": "Bluesky Scraper — Profiles, Posts & Search API",
    "description": "Scrape Bluesky (bsky.app) profiles & posts into clean structured data — followers, bio, engagement counts, media, links. Search by keyword or pull full profiles + post feeds. JSON/CSV/Excel. No login or API key needed.",
    "version": "1.0",
    "x-build-id": "4bidqcYpUnEMmo96C"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~bluesky-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-bluesky-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/sian.agency~bluesky-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-bluesky-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/sian.agency~bluesky-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-bluesky-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": {
          "scrapeMode": {
            "title": "🧭 Scrape Mode",
            "enum": [
              "search",
              "detail"
            ],
            "type": "string",
            "description": "**SEARCH** = cheap list mode. Search Bluesky by keyword and get many profiles or posts, cursor-paginated.\n\n**DETAIL** = full mode. Give specific profiles (handles / DIDs / profile URLs) and get the complete record — follower/following/post counts — plus, optionally, each profile's recent post feed with engagement metrics.",
            "default": "search"
          },
          "recordType": {
            "title": "📁 Record Type (Search mode)",
            "enum": [
              "profiles",
              "posts"
            ],
            "type": "string",
            "description": "In **Search** mode, choose what to return:\n- **Profiles** — accounts matching your term (handle, display name, bio, avatar)\n- **Posts** — posts matching your query (text, author, engagement, media)\n\nIgnored in Detail mode (which always returns profiles, plus posts if you enable the author feed).",
            "default": "profiles"
          },
          "searchTerm": {
            "title": "🔎 Search Term (Search mode)",
            "type": "string",
            "description": "**SINGLE SEARCH:** A keyword or phrase to search Bluesky for. Returns profiles or posts depending on Record Type.\n\n**Examples:** `los angeles`, `wildfire`, `nba`, `climate science`\n\n💡 **TIP:** For posts, add filters below (sort, language, date range, hashtag) to narrow results.",
            "default": "los angeles"
          },
          "searchTerms": {
            "title": "🚀 Bulk Search Terms (Search mode)",
            "uniqueItems": true,
            "type": "array",
            "description": "**BULK SEARCH:** Run several searches in one go — each term is searched separately and all results land in the same dataset.\n\n**TIER-BASED LIMITS:**\n- **FREE users:** results capped per run\n- **PAID users:** unlimited\n\n💡 Click **Bulk edit** to paste one term per line. Use the single Search Term field for one keyword.",
            "items": {
              "type": "string"
            }
          },
          "searchUrl": {
            "title": "🔗 Search URL (Search mode, optional)",
            "type": "string",
            "description": "Paste a Bluesky search API URL instead of a term — filters in the query string are preserved.\n\n**Example:** `https://api.bsky.app/xrpc/app.bsky.feed.searchPosts?q=nba&sort=top&lang=en`\n\nWhen provided, this overrides the Search Term fields."
          },
          "profile": {
            "title": "👤 Single Profile (Detail mode)",
            "type": "string",
            "description": "**DETAIL MODE:** A Bluesky profile to fetch in full. Accepts a handle, a DID, or a profile URL.\n\n**Examples:**\n- `laist.com`\n- `@laist.com`\n- `https://bsky.app/profile/laist.com`\n- `did:plc:kosvedukjcyvdfv64zltdauy`"
          },
          "profiles": {
            "title": "🚀 Bulk Profiles (Detail mode)",
            "uniqueItems": true,
            "type": "array",
            "description": "**BULK DETAIL:** A list of profiles (handles / DIDs / profile URLs) to fetch in full.\n\n**TIER-BASED LIMITS:**\n- **FREE users:** results capped per run\n- **PAID users:** unlimited\n\n💡 Click **Bulk edit** to paste one profile per line.",
            "items": {
              "type": "string"
            }
          },
          "includeFeed": {
            "title": "📝 Also Pull Each Profile's Post Feed",
            "type": "boolean",
            "description": "In **Detail** mode, also fetch each profile's recent posts (with engagement metrics, embeds and media). Adds post rows to the dataset alongside the profile rows.",
            "default": false
          },
          "feedPages": {
            "title": "🔢 Feed Pages Per Profile",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many pages (up to 100 posts each) of the author feed to fetch per profile when **Also Pull Feed** is on.",
            "default": 1
          },
          "sort": {
            "title": "↕️ Sort (Posts search)",
            "enum": [
              "top",
              "latest"
            ],
            "type": "string",
            "description": "Order for **post** searches: `top` (most relevant/engaged) or `latest` (newest first).",
            "default": "latest"
          },
          "lang": {
            "title": "🌐 Language (Posts search)",
            "type": "string",
            "description": "Restrict posts to a BCP-47 language code, e.g. `en`, `es`, `pt`, `ja`."
          },
          "since": {
            "title": "📅 Since (Posts search)",
            "type": "string",
            "description": "Only posts on/after this date. ISO datetime or `yyyy-mm-dd`, e.g. `2025-01-01`."
          },
          "until": {
            "title": "📅 Until (Posts search)",
            "type": "string",
            "description": "Only posts on/before this date. ISO datetime or `yyyy-mm-dd`."
          },
          "author": {
            "title": "✍️ Author (Posts search)",
            "type": "string",
            "description": "Restrict posts to a specific author (handle or DID)."
          },
          "mentions": {
            "title": "@ Mentions (Posts search)",
            "type": "string",
            "description": "Only posts mentioning this handle."
          },
          "domain": {
            "title": "🔗 Link Domain (Posts search)",
            "type": "string",
            "description": "Only posts linking to this domain, e.g. `nytimes.com`."
          },
          "tag": {
            "title": "#️⃣ Hashtag (Posts search)",
            "type": "string",
            "description": "Only posts with this hashtag (omit the `#`)."
          },
          "maxResults": {
            "title": "🔢 Max Records Per Run",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on the total records saved this run. **FREE** runs are capped at 25 regardless of this value; **PAID** runs are unlimited.",
            "default": 100
          },
          "maxPages": {
            "title": "📄 Max Search Pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many cursor pages to fetch per search term (up to 100 records each). Higher = more results, more cost.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}