# Snapchat Public Discover Stories (`w3crawler/snapchat-discover-scraper`) Actor

Read public server-rendered Snapchat Discover result pages and extract complete story, creator, thumbnail, video, and bounded snap-media metadata.

- **URL**: https://apify.com/w3crawler/snapchat-discover-scraper.md
- **Developed by:** [w3crawler](https://apify.com/w3crawler) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 discover stories

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Extract public Snapchat Discover story, creator, thumbnail, video-track, and bounded snap-media metadata from Snapchat’s anonymously rendered Discover page.

### What it returns

Each dataset row is one complete Discover story and can include:

- Story ID, type, title, publication time, tap ID, and result position
- Creator username, display name, public bio/badge, profile URL, profile image, and Snapcode image
- Thumbnail and public video-track URL
- Total snap count plus a bounded `snaps` array with IDs, media types, media URLs, preview URLs, and timing
- Search context and request provenance: keyword, country, sort order, result page, source URL/status, proxy use, method, and timestamp

Bulky raw `__NEXT_DATA__` story objects are not retained. Incomplete stories without a stable ID, title, publication time, thumbnail, and at least one complete snap are excluded.

### Input

```json
{
  "keyword": "sports",
  "country": "us",
  "sortBy": "recent",
  "maxItems": 10,
  "maxPages": 1,
  "maxSnaps": 10,
  "requestDelayMs": 250,
  "timeoutMs": 45000,
  "maxResponseBytes": 4000000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

Runs are bounded to 100 stories, one public feed snapshot, and 100 snaps per story. Unknown fields and invalid country/sort values fail before requests begin.

Snapchat’s current public page returns the same server-rendered feed when keyword query values change and does not expose a public cursor for pagination. The Actor therefore requests the canonical `/discover` page exactly once. `keyword`, `country`, and `sortBy` remain caller-supplied research context, while every record explicitly sets `filtersApplied` to `false` and includes a `filterNotice`.

### Access failures and page changes

The Actor opens the public page in Chromium and inspects rendered `__NEXT_DATA__` plus JSON responses loaded by that anonymous page. It does not call private or login-only endpoints directly. Access challenges, browser failures, missing state, and empty result sets are recorded in the `OUTPUT` key’s bounded `failures` array and counters. They are never mixed into dataset rows.

Chromium uses a stable desktop context, conservative single-page concurrency, bounded retries with Crawlee backoff, response-size/time limits, and direct access by default. Standard Apify Proxy can be enabled when justified. The Actor does not log in, solve CAPTCHAs, patch fingerprints, or bypass access controls.

### Responsible use

Use public data only for lawful research, follow Snap terms and robots guidance, and respect creator privacy, copyright, and media rights. Returned URLs do not grant permission to download, republish, or commercially reuse content.

### Local validation

Run `npm test`, `apify validate-schema`, and `apify run --purge --input-file qa-inputs/snapchat-discover-scraper/local-validation.json`. Inspect the default dataset and `OUTPUT` key.

# Changelog

This Actor's version history is a separate document: https://apify.com/w3crawler/snapchat-discover-scraper/changelog.md

# Actor input Schema

## `keyword` (type: `string`):

Caller-supplied research label retained as context. Snapchat's public Discover HTML does not apply it as a server-side filter.

## `country` (type: `string`):

Caller-supplied two-letter country context. Snapchat's public page does not confirm applying it as a server-side filter.

## `sortBy` (type: `string`):

Caller-supplied ordering context. Snapchat's public page does not expose a server-side sort control.

## `maxItems` (type: `integer`):

Maximum complete Discover story records saved.

## `maxPages` (type: `integer`):

Maximum bounded rendered Discover feed windows. Each additional window scrolls the public page and attempts its visible See more control; no hidden cursor is fabricated.

## `maxSnaps` (type: `integer`):

Maximum complete snap media objects retained per story.

## `requestDelayMs` (type: `integer`):

Delay before each direct request attempt.

## `timeoutMs` (type: `integer`):

Maximum time allowed for each direct HTTPS attempt.

## `maxResponseBytes` (type: `integer`):

Maximum HTML response size read from a public Discover page.

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy configuration. Direct public requests are used by default.

## Actor input object example

```json
{
  "keyword": "discover",
  "country": "us",
  "sortBy": "recent",
  "maxItems": 10,
  "maxPages": 1,
  "maxSnaps": 10,
  "requestDelayMs": 250,
  "timeoutMs": 45000,
  "maxResponseBytes": 4000000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing public Discover story, snap, and diagnostic records.

## `summary` (type: `string`):

OUTPUT record containing request, story, item, and diagnostic counts.

## `sourceMetadata` (type: `string`):

Anonymous browser source and safety disclosures.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/snapchat-discover-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/snapchat-discover-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call w3crawler/snapchat-discover-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/snapchat-discover-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ih2tDswLXR885MIDk/builds/aO5VAMdFEDKlhkEH0/openapi.json
