# Lemon8 Media Scraper: Images, Videos & Downloads (`abotapi/lemon8-media-scraper`) Actor

Lightweight Lemon8 scraper for extracting image and video URLs from posts, with optional media downloads. Built for fast, clean media collection without comments, captions, or other post details.

- **URL**: https://apify.com/abotapi/lemon8-media-scraper.md
- **Developed by:** [Abot API](https://apify.com/abotapi) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 5 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Lemon8 Media Scraper

Lightweight scraper that extracts image and video URLs from Lemon8 posts. Focused on media extraction only - no comments, no post details, just clean media URLs.

### Features

- **Image Extraction** - Get all image URLs from posts
- **Video Extraction** - Extract video URLs from video posts
- **Search Discovery** - Find posts by keyword search
- **Direct URLs** - Scrape specific post URLs
- **High Quality** - Auto-convert thumbnails to high-quality URLs
- **Media Download** - Optional download to Apify key-value store
- **Two Input Modes** - Specific post URLs or a keyword search
- **Multiple Regions** - Support for 10+ countries
- **Reliable Access** - Smart proxy rotation with automatic fallback

### Send results into your apps (MCP connectors)

Optionally pipe the scraped results into the apps you already use, via Model Context Protocol (MCP) connectors. This is an extra delivery step **after** the scrape — the Apify dataset is never changed.

**What gets written to the connector:** a condensed, human-readable **summary** of each record — not the full JSON. Each item becomes one entry with a **title** and its key fields flattened to plain text. The **complete record always stays in the Apify dataset**.

1. Authorize a connector once under **Apify → Settings → Integrations** (Notion, Linear, Airtable, or Apify).
2. Select it in the **"Pipe results into your apps"** input field. (If the picker is empty, you haven't authorized a connector yet.)
3. For **Notion**, also set `notionParentPageUrl` to the page where items should be created.

The connection is mediated by Apify's MCP proxy, so this actor never sees your third-party credentials. Leave the field empty to skip.

### Output Data

Each post is saved as a separate item in the dataset:

```json
{
  "postId": "7543408422994264589",
  "postUrl": "https://www.lemon8-app.com/@username/7543408422994264589?region=us",
  "images": [
    {
      "url": "https://p16-lemon8-sign-va.tiktokcdn.com/tos-maliva-v-ac5634-us/...",
      "alt": "Post image description",
      "type": "image"
    }
  ],
  "videos": [],
  "imageCount": 5,
  "videoCount": 0
}
```

#### With Media Download Enabled

When `downloadMedia: true`, each media item includes a `keystoreKey`:

```json
{
  "postId": "7543408422994264589",
  "images": [
    {
      "url": "https://p16-lemon8-sign-va.tiktokcdn.com/...",
      "alt": "Post image",
      "type": "image",
      "keystoreKey": "7543408422994264589_img_0.webp"
    }
  ],
  "videos": [
    {
      "url": "https://v16-lemon8.tiktokcdn.com/...",
      "poster": "https://p16-lemon8-sign-va.tiktokcdn.com/...",
      "type": "video",
      "keystoreKey": "7543408422994264589_vid_0.mp4"
    }
  ],
  "imageCount": 1,
  "videoCount": 1
}
```

### Input Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `postUrls` | Array | `[]` | Direct post URLs to scrape (overrides searchTerm) |
| `searchTerm` | String | `"fashion"` | Search keyword for discovery page |
| `region` | String | `"us"` | Region code |
| `limit` | Number | `2` | Maximum posts to process (1-100) |
| `saveImages` | Boolean | `true` | Extract image URLs |
| `saveVideos` | Boolean | `true` | Extract video URLs |
| `downloadMedia` | Boolean | `false` | Download files to key-value store |
| `highQuality` | Boolean | `true` | Convert to high-quality URLs |
| `maxScrolls` | Number | `2` | Max scrolls on discovery (1-30) |
| `scrollDelay` | Number | `1000` | Delay between scrolls in ms |
| `clearStorage` | Boolean | `false` | Clear request queue and start fresh |
| `proxy` | Object | `null` | Apify proxy configuration |
| `resumeFromRunId` | String | `""` | Continue one interrupted run/dataset without re-collecting or re-charging its posts |
| `incrementalMode` | Boolean | `false` | Turn on for recurring monitoring — classifies each post as NEW/UPDATED/UNCHANGED/REAPPEARED/EXPIRED against the previous run |
| `stateKey` | String | `""` | Name a monitoring campaign explicitly; otherwise the state key is derived from postUrls/searchTerm + region + saveImages/saveVideos/downloadMedia/highQuality |
| `emitUnchanged` | Boolean | `false` | Also return (and bill) UNCHANGED posts every run |
| `emitExpired` | Boolean | `false` | Also return (and bill) posts no longer found, once a run fully scans every tracked post |

#### Example: Search Discovery

```json
{
  "searchTerm": "fashion",
  "region": "us",
  "limit": 20,
  "saveImages": true,
  "saveVideos": true,
  "downloadMedia": false
}
```

#### Example: Direct Post URLs

```json
{
  "postUrls": [
    "https://www.lemon8-app.com/@username/7543408422994264589",
    "https://www.lemon8-app.com/@another/7550145067198005791"
  ],
  "downloadMedia": true
}
```

#### Available Regions

| Code | Region |
|------|--------|
| us | United States |
| au | Australia |
| nz | New Zealand |
| jp | Japan |
| th | Thailand |
| id | Indonesia |
| vn | Vietnam |
| my | Malaysia |
| sg | Singapore |
| ca | Canada |

### 🔁 Resume & recurring updates

Two different features, both opt-in:

- **Resume** (`resumeFromRunId`) continues ONE specific interrupted run: paste a previous run ID or dataset ID and this run skips posts it already collected.
- **Incremental mode** (`incrementalMode`) is for scheduling this actor on a recurring basis against the same posts/search. The actor remembers what it saw last time (keyed by `stateKey`, or an automatic key derived from postUrls/searchTerm + region + saveImages/saveVideos/downloadMedia/highQuality) and adds four fields to every dataset row:

```json
{
  "changeType": "NEW",
  "changedFields": [],
  "firstSeenAt": "2026-07-31T03:00:00Z",
  "lastSeenAt": "2026-07-31T03:00:00Z"
}
```

`changeType` is one of `NEW`, `UPDATED`, `UNCHANGED`, `REAPPEARED`, `EXPIRED`. `UNCHANGED` and `EXPIRED` posts are suppressed (not returned or billed) unless you turn on `emitUnchanged` / `emitExpired`. `EXPIRED` posts are only produced once a run has scanned every tracked post to its natural end — a Limit cap, a block, or `resumeFromRunId` all skip EXPIRED detection for that run rather than risk a false tombstone. These fields never appear when `incrementalMode` is off.

Lemon8/TikTok CDN image and video URLs are re-signed on every fetch (rotating shard host + signature/expiry tokens); incremental mode normalizes that noise before comparing posts, so a post whose media hasn't actually changed is never spuriously marked UPDATED.

### Storage

#### Key-Value Store

- `INPUT` - Run configuration
- `OUTPUT` - Complete results with all media
- `METADATA` - Run statistics (totalPosts, totalImages, totalVideos, downloadedFiles)
- `{postId}_img_{index}.webp` - Downloaded images (if enabled)
- `{postId}_vid_{index}.mp4` - Downloaded videos (if enabled)

#### Dataset

Each post saved as a separate item for easy export and processing.

#### Accessing Downloaded Files

```
https://api.apify.com/v2/key-value-stores/{storeId}/records/{keystoreKey}
```

### Use Cases

- **Content Archiving** - Save media from posts before they disappear
- **Dataset Building** - Collect images for ML training data
- **Visual Analysis** - Analyze trending visual styles and formats
- **Competitor Research** - Monitor competitor visual content
- **Content Inspiration** - Discover popular image styles

# Actor input Schema

## `postUrls` (type: `array`):

List of specific Lemon8 post URLs to scrape. If provided, searchTerm is ignored.

## `searchTerm` (type: `string`):

Search keyword to find posts on Lemon8 discovery page. Used only if postUrls is empty.

## `region` (type: `string`):

Region code for Lemon8 (us, au, jp, etc.)

## `limit` (type: `integer`):

Maximum number of posts to process (max 100)

## `saveImages` (type: `boolean`):

Extract image URLs from posts

## `saveVideos` (type: `boolean`):

Extract video URLs from posts

## `downloadMedia` (type: `boolean`):

Download media files to key-value store (increases run time and storage)

## `highQuality` (type: `boolean`):

Convert thumbnail URLs to high quality versions

## `proxy` (type: `object`):

Proxy for requests. Defaults to Apify datacenter (US); if the datacenter tunnel is unavailable or gets blocked, the actor automatically falls back to a backup proxy pool.

## `resumeFromRunId` (type: `string`):

Paste a previous run ID or dataset ID to continue a large pull of posts without returning or charging for posts already collected there. Use this after an interrupted run, or when continuing a pull in another run. For recurring monitoring of the same posts/search, use Incremental mode below instead.

## `incrementalMode` (type: `boolean`):

Turn this on for daily or recurring monitoring. The first run returns all matching posts as NEW. Later runs normally return only NEW, UPDATED, and REAPPEARED posts. Turn on "Emit unchanged" or "Emit expired" only when you also want those posts returned (and billed). State is kept separately for each postUrls/searchTerm, region, and media-option combination; use State key when you want to name or deliberately share a monitoring campaign. To continue one specific interrupted run instead, use Resume from a previous run above.

## `stateKey` (type: `string`):

Optional. Name this monitoring campaign to keep its state stable, or to deliberately share state across differently-configured runs. Leave empty to let the actor derive a key automatically from postUrls/searchTerm, region, and the media options — different setups then never mix state with each other.

## `emitUnchanged` (type: `boolean`):

Off by default. Turn on to also return posts that have not changed since the last run, marked UNCHANGED. This returns — and bills — extra rows you already have, so leave it off unless you specifically want the full snapshot every run.

## `emitExpired` (type: `boolean`):

Off by default. Turn on to also return posts that were present in a previous run but are no longer found, marked EXPIRED. Only produced once a run has fully scanned every tracked post — not when Limit capped it, or when Resume was used. This returns — and bills — extra synthetic rows, so leave it off unless you need expiry tracking.

## `mcpConnectors` (type: `array`):

Optionally send the scraped results into the apps you already use, via Model Context Protocol (MCP) connectors. Authorize a connector once under Apify → Settings → Integrations, then select it here. The connector receives a condensed, human-readable summary per item (title + key fields), not the full JSON — the complete record stays in the dataset. Leave empty to skip. Supported: Notion (https://mcp.notion.com/mcp), Linear (https://mcp.linear.app/sse), Airtable (https://mcp.airtable.com/mcp), Apify (https://mcp.apify.com).

## `notionParentPageUrl` (type: `string`):

URL (or id) of the Notion page under which item pages are created. Required to enable the Notion export; ignored by other connectors.

## `maxNotifyListings` (type: `integer`):

Cap on items written to each connector per run. Does not affect the dataset.

## Actor input object example

```json
{
  "searchTerm": "fashion",
  "region": "us",
  "limit": 2,
  "saveImages": true,
  "saveVideos": true,
  "downloadMedia": false,
  "highQuality": true,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  },
  "incrementalMode": false,
  "emitUnchanged": false,
  "emitExpired": false,
  "maxNotifyListings": 50
}
```

# Actor output Schema

## `overview` (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 = {
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyCountry": "US"
    },
    "incrementalMode": false,
    "emitUnchanged": false,
    "emitExpired": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("abotapi/lemon8-media-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 = {
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyCountry": "US",
    },
    "incrementalMode": False,
    "emitUnchanged": False,
    "emitExpired": False,
}

# Run the Actor and wait for it to finish
run = client.actor("abotapi/lemon8-media-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 '{
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  },
  "incrementalMode": false,
  "emitUnchanged": false,
  "emitExpired": false
}' |
apify call abotapi/lemon8-media-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,abotapi/lemon8-media-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/cXSgNkaph4Oa2t7fz/builds/3sUWKG07JIbo1BIgk/openapi.json
