# Upscrape Product Hunt 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/producthunt/openapi.json?token=SFMyNTY.g2gDdAAAAAFtAAAAC3BsYXRmb3JtX2lkbQAAAAtwcm9kdWN0aHVudG4GAB5nD0qfAWIAAVGA.vgb3V_68lIu3DjiC9sEfh6GPvxZHu7u0W0nkVBU6ES0
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 bodies, errors, and JSON schemas.
- Do not infer fields from capability descriptions; fetch the spec and use its component schemas.
- 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}`.
- `stream` is public-facing but must remain `false` today.

## API Base

- Base URL: `https://data.upscrape.com`
- OpenAPI spec: `https://data.upscrape.com/catalog/platforms/producthunt/openapi.json?token=SFMyNTY.g2gDdAAAAAFtAAAAC3BsYXRmb3JtX2lkbQAAAAtwcm9kdWN0aHVudG4GAB5nD0qfAWIAAVGA.vgb3V_68lIu3DjiC9sEfh6GPvxZHu7u0W0nkVBU6ES0`
- 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 exact shape is defined by the OpenAPI component schema for the selected capability.

## Example Execute Request

```json
{
  "capability": "producthunt.category",
  "input": {
    "max_products": 5,
    "url": "ai-meeting-notetakers"
  }
}
```

## 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
- `stream`: must be `false`

## Supported Capabilities

- `producthunt.category` - Get Category. Fetch a Product Hunt category with subcategories, parent category, and ranked product listing. Max `timeout_ms`: 30000. Streaming: disabled.
- `producthunt.feed` - RSS Feed. Stream Product Hunt RSS feed entries of recent launches, optionally filtered by category. Max `timeout_ms`: 60000. Streaming: disabled.
- `producthunt.homepage` - Get Homepage. Get today's featured launches from the Product Hunt homepage. Max `timeout_ms`: 30000. Streaming: disabled.
- `producthunt.leaderboard` - Get Leaderboard. Get Product Hunt top-ranked products for a daily, weekly, monthly, or yearly period. Max `timeout_ms`: 30000. Streaming: disabled.
- `producthunt.product` - Get Product. Fetch a Product Hunt product with ratings, reviews, categories, topics, awards, alternatives, and maker credits. Max `timeout_ms`: 30000. Streaming: disabled.
- `producthunt.product.reviews` - List Product Reviews. Stream reviews on a Product Hunt product with sub-ratings, feedback text, and reviewer profiles. Max `timeout_ms`: 60000. Streaming: disabled.
- `producthunt.search` - Search Products. Search Product Hunt for products by keyword and return matched product listings. Max `timeout_ms`: 60000. Streaming: disabled.
- `producthunt.topic` - Get Topic. Fetch a Product Hunt topic with description, follower count, and ranked product listing. Max `timeout_ms`: 30000. Streaming: disabled.
- `producthunt.user` - Get User. Fetch a Product Hunt user profile with social links, follower counts, and made/hunted/stacked products. Max `timeout_ms`: 30000. Streaming: disabled.