# Snapchat Snapcode and Public Page Extractor (`w3crawler/snapchat-snapcode-scraper`) Actor

Extract bounded Snapcode SVG and normalized records from public HTTP(S) pages with explicit diagnostics.

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

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

## Snapchat Snapcode and Public Page Extractor

Read public Snapchat Snapcode SVG endpoints and other public HTTP(S) pages, then return bounded normalized records. The default target is Snapchat's public Snapcode SVG endpoint.

Despite the historical scraper name, this Actor does not create or publish a separate binary PNG/SVG artifact. SVG responses are stored as bounded text inside the normalized record data. It does not log in, solve CAPTCHAs, bypass access controls, or access private data.

### What it does

- accepts public HTTP(S) start URLs, including Snapcode SVG endpoints;
- uses one-attempt bounded HTTP with optional Apify proxying, response-size limits, timeouts, request delay, and concurrency controls;
- recognizes SVG Snapcode responses, JSON/JSON-LD arrays, visible HTML cards, and public page metadata;
- optionally follows same-host next links within maxPages;
- emits one stable normalized Snapcode or publicRecord row per unique record;
- keeps explicit diagnostics in OUTPUT when a page is unavailable, blocked, oversized, malformed, or has no recognizable record;
- writes OUTPUT\_SUMMARY, compatibility OUTPUT, and SOURCE\_METADATA artifacts.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| startUrls | array | Snapchat Snapcode SVG endpoint | Public HTTP(S) pages or endpoints, up to 100. |
| maxItems | integer | 25 | Maximum unique normalized records, from 1 to 100. |
| maxPages | integer | 1 | Maximum page requests including pagination, from 1 to 10. |
| followPagination | boolean | false | Follow same-host next links within maxPages. |
| requestDelayMs | integer | 600 | Delay before each request, from 0 to 30000 milliseconds. |
| maxConcurrency | integer | 1 | Concurrent requests, from 1 to 5. |
| timeoutSecs | integer | 45 | Per-request timeout, from 5 to 60 seconds. |
| maxResponseBytes | integer | 5000000 | Maximum response body retained in memory, from 100000 to 10000000 bytes. |
| proxyConfiguration | object | Direct connection | Optional Apify proxy configuration for public targets that require it. |

#### Snapcode SVG example

```json
{
  "startUrls": [
    {
      "url": "https://feelinsonice.appspot.com/web/deeplink/snapcode?username=snapchat&type=SVG"
    }
  ],
  "maxItems": 1,
  "maxPages": 1,
  "followPagination": false,
  "requestDelayMs": 600,
  "maxResponseBytes": 5000000
}
```

#### Public page example

```json
{
  "startUrls": [{ "url": "https://www.snapchat.com/discover" }],
  "maxItems": 25,
  "maxPages": 1,
  "followPagination": false
}
```

### Output

Normalized public rows use recordType Snapcode or publicRecord and stable recordId values. A Snapcode record preserves bounded SVG text inside data.

```json
{
  "recordType": "Snapcode",
  "recordId": "public_record_…",
  "status": "success",
  "accessStatus": "SUCCESS",
  "found": true,
  "dataAvailable": true,
  "id": "source-identifier",
  "name": "Snapcode for snapchat",
  "url": "https://feelinsonice.appspot.com/web/deeplink/snapcode?username=snapchat&type=SVG",
  "sourceUrl": "https://feelinsonice.appspot.com/web/deeplink/snapcode?username=snapchat&type=SVG",
  "sourceDomain": "feelinsonice.appspot.com",
  "type": "Snapcode",
  "data": {
    "username": "snapchat",
    "format": "SVG",
    "svg": "<svg>...</svg>"
  },
  "sourceTransport": "direct HTTP"
}
```

Diagnostics are stored in OUTPUT rather than the dataset. They include code, message, target/source/HTTP details, request limits, and transport metadata. Common codes include HTTP\_404, ACCESS\_BLOCKED\_HTTP\_403, RESPONSE\_TOO\_LARGE, PAGE\_PARSE\_ERROR, and NO\_PUBLIC\_RECORDS.

### Storage and local QA

- Dataset rows are written to {{links.apiDefaultDatasetUrl}}/items.
- OUTPUT\_SUMMARY is the structured run summary; OUTPUT is a compatibility alias.
- SOURCE\_METADATA records the public-only policy and confirms that authentication, private APIs, binary media downloads/storage, and CAPTCHA solving were not used.
- Local runs use storage/datasets/default/ and storage/key\_value\_stores/default/.
- npm test, npm run lint, npm audit --audit-level=high, apify validate-schema, and node validate-datasets.js cover the local contract.

### Limits and reliability

Response bodies are bounded before parsing or storage. Redirects are safe-URL checked and capped at three hops; pagination is same-host and bounded by maxPages. Public page layouts, Snapcode endpoints, rate limits, and source fields can change, so a diagnostic is the expected result when a public record is not available.

Use this Actor only for lawful, authorized collection of public information. Respect Snapchat and source-site terms, privacy rights, rate limits, and applicable data-protection requirements.

# Changelog

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

# Actor input Schema

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

Public HTTP(S) pages or endpoints.

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

Hard maximum number of unique normalized records saved.

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

Maximum number of public pages/endpoints requested, including pagination.

## `followPagination` (type: `boolean`):

Follow same-host next-page links up to maxPages.

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

Delay before each public page request.

## `maxConcurrency` (type: `integer`):

Maximum concurrent public requests, from 1 to 5.

## `timeoutSecs` (type: `integer`):

Per-request timeout for public pages.

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

Maximum public response body size retained in memory.

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

Optional Apify proxy configuration. Direct requests are the default; enable proxying only when the public target requires it.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://feelinsonice.appspot.com/web/deeplink/snapcode?username=snapchat&type=SVG"
    }
  ],
  "maxItems": 25,
  "maxPages": 1,
  "followPagination": false,
  "requestDelayMs": 600,
  "maxConcurrency": 1,
  "timeoutSecs": 45,
  "maxResponseBytes": 5000000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

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

No description

## `sourceMetadata` (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 = {
    "startUrls": [
        {
            "url": "https://feelinsonice.appspot.com/web/deeplink/snapcode?username=snapchat&type=SVG"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("w3crawler/snapchat-snapcode-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 = { "startUrls": [{ "url": "https://feelinsonice.appspot.com/web/deeplink/snapcode?username=snapchat&type=SVG" }] }

# Run the Actor and wait for it to finish
run = client.actor("w3crawler/snapchat-snapcode-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 '{
  "startUrls": [
    {
      "url": "https://feelinsonice.appspot.com/web/deeplink/snapcode?username=snapchat&type=SVG"
    }
  ]
}' |
apify call w3crawler/snapchat-snapcode-scraper --silent --output-dataset

```

## MCP server setup

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