# Upscrape Bluesky LLM Integration Prompt

Give this to an LLM or coding agent. It must fetch the OpenAPI spec first and use this brief only for orientation.

## First Step

Fetch and read this OpenAPI spec before writing code:

https://data.upscrape.com/catalog/platforms/bluesky/openapi.json?token=SFMyNTY.g2gDdAAAAAFtAAAAC3BsYXRmb3JtX2lkbQAAAAdibHVlc2t5bgYAmaBi358BYgABUYA.zDy6MqNT-q_CNBXoQa9PzK87cL5kc_MnpSBFA325ELc
This signed OpenAPI URL is valid for approximately 7 days.

## Hard Rules

- Use the OpenAPI spec as the source of truth for endpoints, request bodies, response envelopes, errors, and input JSON schemas.
- Raw capability output is intentionally open-ended. Treat any included output example as illustrative, not as a fixed schema.
- Authenticate every request with `Authorization: Bearer YOUR_API_KEY`.
- Start runs with `POST /execute`; do not invent platform-specific execute endpoints.
- Poll `GET /jobs/{id}` or `GET /jobs/{id}/result` until `state` is `completed` or `failed`.
- Optionally send `Prefer: wait=N` on `POST /execute` to wait up to N seconds for inline results.
- If the response is `200`, the job completed — read `results[0].data`. If `202`, poll `GET /jobs/{id}`.

## API Base

- Base URL: `https://data.upscrape.com`
- OpenAPI spec: `https://data.upscrape.com/catalog/platforms/bluesky/openapi.json?token=SFMyNTY.g2gDdAAAAAFtAAAAC3BsYXRmb3JtX2lkbQAAAAdibHVlc2t5bgYAmaBi358BYgABUYA.zDy6MqNT-q_CNBXoQa9PzK87cL5kc_MnpSBFA325ELc`
- Execute endpoint: `POST /execute`
- Job poll endpoint: `GET /jobs/{id}`
- Result alias: `GET /jobs/{id}/result`
- Content-Type: `application/json`
- Optional header: `Idempotency-Key`
- Optional header: `Prefer: wait=N` (hold connection up to N seconds for synchronous result)

## Execution Flow

1. Send `POST /execute` with a platform capability ID and its `input` object.
2. The API responds with a queued `job_id`.
3. Poll the job endpoint until `state` becomes `completed` or `failed`.
4. If completed, read `results[0].data`; its raw JSON shape may evolve with the upstream source.

## Example Execute Request

```json
{
  "capability": "bluesky.actor.get_followers",
  "input": {
    "actor": "bsky.app",
    "limit": 20,
    "max_pages": 2
  }
}
```

## Optional Request Fields

- `network.session_id`: explicit reusable session identifier
- `network.session_key`: stable key used to derive a reusable session
- `network.sticky`: reuse the resolved session when `true`
- `timeout_ms`: per-capability timeout override up to the capability maximum listed below

## Supported Capabilities

- `bluesky.actor.get_followers` - Get followers. List followers for a Bluesky actor. Max `timeout_ms`: 120000.
- `bluesky.actor.get_follows` - Get follows. List actors followed by a Bluesky actor. Max `timeout_ms`: 120000.
- `bluesky.actor.get_profile` - Get profile. Fetch profile metadata for a Bluesky actor. Max `timeout_ms`: 120000.
- `bluesky.actor.resolve_handle` - Resolve handle. Resolve a Bluesky handle to its DID. Max `timeout_ms`: 120000.
- `bluesky.actor.search` - Search actors. Search actors by keyword with cursor pagination. Max `timeout_ms`: 120000.
- `bluesky.feed.get_author_feed` - Get author feed. Fetch an author's public posts feed with cursor pagination. Max `timeout_ms`: 120000.
- `bluesky.feed.get_feed` - Get feed posts. Fetch posts from a specific feed URI with cursor pagination. Max `timeout_ms`: 120000.
- `bluesky.feed.get_feed_generators` - Get feed generators. Discover popular feed sources used by the Bluesky app. Max `timeout_ms`: 120000.
- `bluesky.feed.get_likes` - Get post likes. List users who liked a post with cursor pagination. Max `timeout_ms`: 120000.
- `bluesky.feed.get_post_thread` - Get post thread. Fetch a post thread with bounded nested replies depth. Max `timeout_ms`: 120000.
- `bluesky.feed.get_reposted_by` - Get repost users. List users who reposted a post with cursor pagination. Max `timeout_ms`: 120000.
- `bluesky.feed.get_trending_topics` - Get trending topics. List trending topics surfaced by public feed index data. Max `timeout_ms`: 120000.
- `bluesky.feed.search_posts` - Search posts. Search Bluesky posts and return paginated records. Max `timeout_ms`: 120000.