# Snapchat Hashtag Spotlight Scraper (`w3crawler/snapchat-hashtag-scraper`) Actor

Read public Snapchat Explore topic pages and extract normalized Spotlight cards, creator metadata, engagement counts, media URLs, and source page metadata.

- **URL**: https://apify.com/w3crawler/snapchat-hashtag-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 hashtag spotlights

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 normalized public Spotlight cards from Snapchat Explore topic pages. Inputs can be hashtag names, values beginning with `#`, or exact public Snapchat `/explore/` and `/topic/` URLs.

### What it returns

Each dataset row is one complete Spotlight result and can include:

- Stable result ID, raw snap/story IDs, Spotlight URL, result position, and searched hashtag
- Creator username, display name, public profile URL, follower count, and source-provided tier
- Description, caption, title, observed hashtags, play count, duration, dimensions, and media flags
- Thumbnail plus optional source-provided watermarked and unwatermarked video URLs
- Creation/expiration time, music fields, related topics, page metadata, and optional source-provided LLM caption metadata
- Source URL/status, proxy use, extraction method, and timestamp

Bulky raw card and snap objects are not retained. Incomplete cards without stable IDs, creator details, description, media, dimensions, hashtag context, and creation time are excluded.

### Input

```json
{
  "hashtags": ["food", "#travel"],
  "resultsPerHashtag": 10,
  "includeVideoUrls": true,
  "includeRelatedTopics": true,
  "includeLlmMetadata": false,
  "requestDelayMs": 250,
  "timeoutMs": 45000,
  "maxResponseBytes": 4000000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

Runs are bounded to 20 unique topics and 32 records per topic. Unknown fields, invalid topic values, and off-scope URLs fail before requests begin.

### Access failures and page changes

The Actor expects a public `__NEXT_DATA__` payload on `www.snapchat.com/explore/<topic>`. Access challenges, HTTP failures, missing state, and empty/incomplete result pages are written to the `OUTPUT` key’s bounded `failures` array and counters, not to the dataset.

Requests use a transparent Actor user agent, no retries, bounded response sizes/timeouts, and Apify Proxy by default in Cloud runs. The Actor does not log in, solve CAPTCHAs, patch fingerprints, or bypass access controls.

Video and image URLs can expire. Source-provided AI/LLM metadata is clearly labeled; this Actor does not generate it.

### 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-hashtag-scraper/local-validation.json`. Inspect both the default dataset and `OUTPUT` key.

# Actor input Schema

## `hashtags` (type: `array`):

Hashtag names, values beginning with #, or public Snapchat /explore/ and /topic/ URLs. Up to 20 values are processed.

## `resultsPerHashtag` (type: `integer`):

Maximum complete Spotlight records saved for each hashtag. Snapchat commonly exposes up to 32 server-rendered cards.

## `includeVideoUrls` (type: `boolean`):

Include source-provided watermarked and unwatermarked video URLs when available. URLs may expire.

## `includeRelatedTopics` (type: `boolean`):

Include distinct hashtag/topic values observed in the same public page state.

## `includeLlmMetadata` (type: `boolean`):

Include source-provided LLM-generated caption metadata when present. The Actor does not generate this field.

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

Delay before each direct HTTP request attempt.

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

Maximum time allowed for each direct HTTPS attempt.

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

Maximum HTML response size read from a public Explore page.

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

Apify Proxy configuration. Enabled by default for Cloud runs.

## Actor input object example

```json
{
  "hashtags": [
    "food"
  ],
  "resultsPerHashtag": 30,
  "includeVideoUrls": true,
  "includeRelatedTopics": true,
  "includeLlmMetadata": true,
  "requestDelayMs": 250,
  "timeoutMs": 45000,
  "maxResponseBytes": 4000000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `runSummary` (type: `string`):

No description

# 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 = {
    "hashtags": [
        "food"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/snapchat-hashtag-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 = { "hashtags": ["food"] }

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/snapchat-hashtag-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 '{
  "hashtags": [
    "food"
  ]
}' |
apify call w3crawler/snapchat-hashtag-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,w3crawler/snapchat-hashtag-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/nAldIb4nuZ0CgGTsP/builds/U5oasmidbLUR1aE1g/openapi.json
