# pexels-scraper (`knobby_wallpaper/pexels-scraper`) Actor

Extract stock videos and images in bulk from Pexels using the official fast, reliable API.

- **URL**: https://apify.com/knobby\_wallpaper/pexels-scraper.md
- **Developed by:** [Apex Data Solutions](https://apify.com/knobby_wallpaper) (community)
- **Categories:** Automation, Developer tools, Videos
- **Stats:** 3 total users, 2 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## Pexels Video & Image Bulk Scraper

The most reliable, high-performance, and cost-effective Apify Actor for downloading high-quality stock videos and images in bulk from Pexels. Designed specifically for AI video generators, faceless content creators, and marketing automation pipelines.

***

### 🚀 Why Use This Scraper?

Unlike standard scrapers that try to scrape Pexels' web pages directly—which leads to frequent IP blocks, slow page loads, and Cloudflare 403 Forbidden errors—this Actor is built on top of the **official Pexels REST API**.

- **100% Ban-Free & Reliable**: Zero scraping blocks, no CAPTCHAs, and no proxies needed.
- **Insanely Fast**: Crawls and structures hundreds of videos and images in seconds.
- **Direct MP4 Links**: Extracts direct high-resolution `.mp4` video downloads and direct image URLs. No page crawling, no scraping, just pure direct media URLs ready for download or AI models.
- **No Pexels Account Required**: Comes with a built-in fallback API key so you can start scraping immediately. You can also provide your own free key (which gives you 25,000 free requests per month) for heavy scaling.

***

### 🛠️ Configuration Options

This Actor is highly customizable. In the Apify Console, you can configure:

- `query` (String, **Required**): The keyword you want to search (e.g., `nature`, `cyberpunk`, `meditation`, `office`).
- `mediaType` (Enum): Filter search results by `Both Videos & Images`, `Videos Only`, or `Images Only`.
- `orientation` (Enum, **Optional**): Filter by `Any Orientation`, `Landscape` (horizontal), `Portrait` (vertical - perfect for TikTok, YouTube Shorts, and Instagram Reels!), or `Square`.
- `size` (Enum, **Optional**): Filter by `Any Size`, `Large` (HD & 4K), `Medium`, or `Small`.
- `color` (String, **Optional**): Filter images by dominant color. You can enter a color name (e.g., `red`, `blue`, `green`) or a hex code (e.g., `#ff0000`). *Note: Pexels API only supports color filtering for images.*
- `locale` (Enum, **Optional**): Define the search language/locale (e.g., `en-US`, `es-ES`, `ja-JP`).
- `maxResults` (Integer): The maximum number of results you want to retrieve.
- `apiKey` (String, **Optional**): Your custom Pexels API key. If left blank, the Actor uses a default fallback key.

***

### 📈 Trending & High-Demand Search Queries

To help you get the most out of your bulk downloads, here are some of the most popular stock search terms for content creation:

- **AI & Technology**: `artificial intelligence`, `cyberpunk`, `coding`, `neon city`, `metaverse`, `robotics`.
- **Faceless Channel Themes**: `lofi aesthetic`, `meditation`, `rain on window`, `relaxing nature`, `asmr`, `minimalist workspace`.
- **B2B & Office**: `business meeting`, `remote work`, `teamwork`, `office presentation`, `crypto trading`.
- **Lifestyle & Fitness**: `gym workout`, `yoga morning`, `healthy eating`, `running track`, `urban lifestyle`.
- **Transitions & Drone**: `city timelapse`, `drone landscape`, `slow motion crowd`, `cinematic sunset`.

***

### 📊 Output Data Structure

The results are pushed directly to your default Apify Dataset. Below are examples of the data structure.

#### For Videos:

```json
{
  "id": 857064,
  "type": "video",
  "search_query": "waterfall",
  "alt_text": "Video by Kelly Lacy",
  "url": "https://www.pexels.com/video/drone-shot-of-a-beautiful-waterfall-857064/",
  "width": 3840,
  "height": 2160,
  "duration_seconds": 15,
  "author_name": "Kelly Lacy",
  "author_url": "https://www.pexels.com/@kelly-lacy",
  "author_id": 12345,
  "preview_url": "https://images.pexels.com/videos/857064/pictures/preview.jpg",
  "download_url": "https://player.vimeo.com/external/371433846.hd.mp4?s=...",
  "alternative_resolutions": [
    {
      "quality": "hd",
      "file_type": "video/mp4",
      "width": 1920,
      "height": 1080,
      "link": "https://player.vimeo.com/external/371433846.hd.mp4?s=..."
    },
    {
      "quality": "sd",
      "file_type": "video/mp4",
      "width": 960,
      "height": 540,
      "link": "https://player.vimeo.com/external/371433846.sd.mp4?s=..."
    }
  ]
}
```

#### For Images:

```json
{
  "id": 3408744,
  "type": "image",
  "search_query": "waterfall",
  "alt_text": "Scenic View of Waterfall",
  "url": "https://www.pexels.com/photo/scenic-view-of-waterfall-3408744/",
  "width": 4000,
  "height": 6000,
  "avg_color": "#4A5247",
  "author_name": "Tomáš Malík",
  "author_url": "https://www.pexels.com/@maliktomas",
  "author_id": 98765,
  "preview_url": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500",
  "download_url": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg",
  "alternative_resolutions": {
    "original": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg",
    "large2x": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",
    "large": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg?auto=compress&cs=tinysrgb&h=650&w=940",
    "medium": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg?auto=compress&cs=tinysrgb&h=350&w=300",
    "small": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg?auto=compress&cs=tinysrgb&h=130&w=200",
    "portrait": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800",
    "landscape": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200",
    "tiny": "https://images.pexels.com/photos/3408744/pexels-photo-3408744.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=200&w=280"
  }
}
```

***

### 💵 Monetization (Pay-Per-Event)

This Actor uses the **Pay-Per-Event (PPE)** pricing model. You only pay for the exact amount of items extracted.

- **Price**: **$1.00 per 1,000 media items** ($0.001 per item).
- **Minimum compute overhead**: Uses ultra-lightweight async Python, running in seconds on the minimal 256MB RAM allocation, keeping Apify compute usage costs near $0.

***

### 🔑 Getting Your Own Free Pexels API Key

If you are running bulk extractions (over 5,000 items per day), it is recommended to get your own API key:

1. Go to [Pexels API Page](https://www.pexels.com/api/).
2. Click **Get Started** and register a free account.
3. Fill in your project name and description to instantly generate your key (it is completely free and takes 10 seconds!).

# Actor input Schema

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

The search keyword (e.g., 'nature', 'technology', 'fitness').

## `mediaType` (type: `string`):

Choose whether to scrape videos, images, or both.

## `orientation` (type: `string`):

Filter media by kuvasuhde (e.g. Portrait for TikTok/Reels).

## `size` (type: `string`):

Filter media by size/resolution.

## `color` (type: `string`):

Filter images by color. Enter a hex code (e.g., #ff0000) or color name (e.g., red, blue, green).

## `locale` (type: `string`):

The locale/language for the search query.

## `maxResults` (type: `integer`):

Maximum number of items to extract.

## `apiKey` (type: `string`):

Your custom Pexels API key. If left blank, the Actor will use a built-in fallback key. Get your free key at https://www.pexels.com/api/

## Actor input object example

```json
{
  "query": "waterfall",
  "mediaType": "both",
  "orientation": "any",
  "size": "any",
  "locale": "en-US",
  "maxResults": 50
}
```

# 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 = {
    "query": "waterfall"
};

// Run the Actor and wait for it to finish
const run = await client.actor("knobby_wallpaper/pexels-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 = { "query": "waterfall" }

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

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

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

```

## CLI example

```bash
echo '{
  "query": "waterfall"
}' |
apify call knobby_wallpaper/pexels-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=knobby_wallpaper/pexels-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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