# Snapchat Public Lens Explorer Scraper (`w3crawler/snapchat-lens-scraper`) Actor

Discover public Snapchat Lens Explorer entries, optionally enrich public lens detail pages, and return creator, preview, related-lens, and Spotlight-usage metadata.

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

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

Discover normalized public Snapchat Lens metadata from Lens Explorer, explicit public lens/unlock URLs, or 32-character lens UUIDs. Optional detail-page enrichment adds related lenses, Spotlight usage, page metadata, and public creator/preview fields.

### What it returns

Each dataset row is one complete public lens and can include:

- Lens UUID, source ID, name, canonical lens URL, official-lens flag, and last-update value
- Creator display name, username, public profile URL, and search tags
- Preview image/video, icon, unlock URL, and normalized search tags
- Lens category/public flag, normalized related lenses, and normalized Spotlight usage entries/count
- Detail page title, description, visible text, JSON-LD, source pages/types, fetch status, proxy use, and timestamp

Raw Lens Explorer, detail-page, and lens-resource payloads are not exposed. Missing fields are omitted, and incomplete lenses without stable identity, creator, preview, icon, unlock, and tag fields are excluded.

### Input

```json
{
  "startUrls": [{ "url": "https://www.snapchat.com/lens" }],
  "lensUrls": [],
  "uuids": [],
  "query": "",
  "maxItems": 5,
  "includeDetails": true,
  "requestDelayMs": 250,
  "timeoutMs": 45000,
  "maxResponseBytes": 4000000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

Inputs are restricted to public Snapchat `/lens`, `/lens/<uuid>`, and `/unlock` URLs. Runs are bounded to 20 discovery URLs, 100 explicit lens URLs, 100 UUIDs, and 100 records. The optional query is a local case-insensitive filter over discovered public lens data.

### Access failures and page changes

Access challenges, HTTP failures, missing state, detail failures, and incomplete records are written to the `OUTPUT` key’s bounded `failures` array and counters, not to dataset rows. A failed optional detail request does not discard a complete Explorer record.

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.

### Responsible use

Use public data only for lawful research, follow Snap terms and robots guidance, and respect creator privacy, trademarks, copyright, and lens/media rights. Returned URLs and metadata do not grant reuse or redistribution rights.

### Local validation

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

# Actor input Schema

## `startUrls` (type: `array`):

Public HTTPS Snapchat Lens Explorer, lens-detail, or unlock URLs. If omitted, the public Lens Explorer is used.

## `lensUrls` (type: `array`):

Optional public HTTPS Snapchat lens-detail or unlock URLs to add to discovery.

## `uuids` (type: `array`):

Optional 32-character hexadecimal public lens UUIDs. Up to 100 are accepted.

## `query` (type: `string`):

Case-insensitive local filter over discovered lens name, creator, and source tags.

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

Maximum complete public lens records saved.

## `includeDetails` (type: `boolean`):

Fetch each selected public lens page for related lenses, Spotlight usage, and detail metadata.

## `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 Lens page.

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

Apify Proxy configuration. Enabled by default for Cloud runs.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.snapchat.com/lens"
    }
  ],
  "lensUrls": [],
  "uuids": [],
  "query": "",
  "maxItems": 5,
  "includeDetails": 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/snapchat-lens-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-lens-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-lens-scraper --silent --output-dataset

```

## MCP server setup

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