> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reddit

> Reddit data via Apify.

Reddit data via Apify. Search posts across subreddits by keyword, returning titles, bodies, votes, authors, and timestamps. Keep maxItems small to stay inside the sync timeout.

1 endpoint available through Lava's AI Gateway. See the [Reddit API docs](https://docs.apify.com/api/v2) for full documentation.

<Info>Supports both **managed** (Lava's API keys) and **unmanaged** (bring your own credentials) mode.</Info>

## Endpoints

### Search Reddit posts across all subreddits by keyword. Returns title, body, votes, author, subreddit, timestamps, and media. Use `searches` (array of queries) with `maxItems` to cap result count. IMPORTANT: this runs synchronously through the gateway's short serverless function window, keep `maxItems` small (≤10) and set `skipComments: true` and `skipUserPosts: true` to stay inside the window. Larger queries will 504-timeout. For more results, break into multiple calls or use targeted subreddit URLs via `startUrls` instead of cross-Reddit search. \$3.40 per 1,000 results.

**POST** `https://api.apify.com/v2/acts/trudax~reddit-scraper-lite/run-sync-get-dataset-items` — \$0.085 / request

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.apify.com/v2/acts/trudax~reddit-scraper-lite/run-sync-get-dataset-items', {
      body: {
    "searches": [
      "AI agents paid APIs"
    ],
    "maxItems": 5,
    "searchPosts": true,
    "searchComments": false,
    "skipUserPosts": true,
    "skipComments": true,
    "proxy": {
      "useApifyProxy": true
    }
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.apify.com%2Fv2%2Facts%2Ftrudax~reddit-scraper-lite%2Frun-sync-get-dataset-items" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"searches":["AI agents paid APIs"],"maxItems":5,"searchPosts":true,"searchComments":false,"skipUserPosts":true,"skipComments":true,"proxy":{"useApifyProxy":true}}'
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
