# Pexels Scraper - Free Stock Photos & Videos (No API Key) (`memo23/pexels-scraper`) Actor

Scrape free stock photos & videos from Pexels — no API key or account needed. Direct download URLs at every size/quality, plus tags, colour palette, dimensions and the photographer's profile & socials. Search, by ID, by collection, or a photographer's whole portfolio

- **URL**: https://apify.com/memo23/pexels-scraper.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Categories:** AI, Developer tools, Agents
- **Features:** Limited permissions
- **Stats:** 419 total users, 184 monthly users, 99.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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/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

## Pexels Stock Photo & Video Scraper

Pull free stock **photos and videos** from [Pexels](https://www.pexels.com) at scale — **no API key, no account, nothing to sign up for**. Search by keyword, look media up by ID, grab a whole collection, or export a photographer's entire portfolio. Every row comes with direct CDN download URLs at every size and quality, plus rich metadata.

Built for content teams, ML/AI dataset builders, digital-asset workflows, and anyone who needs royalty-free imagery in bulk.

#### ✨ Why use this scraper?

- **Zero setup** — no Pexels API key or login required. Paste a query and run.
- **Photos *and* videos** — direct download links for every image size and every video rendition (with a convenience "highest quality" link).
- **Rich metadata** — tags, dominant colour + full colour palette, dimensions, aspect ratio, orientation, license, and the photographer's profile including **Instagram, location, avatar and donation link**.
- **Four ways in** — keyword search, by photo/video ID, by collection, or a photographer's full portfolio.
- **De-duplicated & pay-per-result** — you're charged per media record, nothing else.

#### How it works

1. Pick a **mode**: `search`, `curated`, `byPhotoId`, `byCollection`, `byUser`, or `similarPhotos`.
2. Fill the matching field (a query, some IDs, a collection URL, or a photographer handle) — or nothing for `curated`.
3. Set your limits and run. Results stream to the dataset — export as JSON, CSV, Excel, or via the API.

#### Modes

| Mode | What you give it | What you get |
|---|---|---|
| **search** | a keyword + media type | matching photos and/or videos |
| **curated** | nothing (just media type) | Pexels' discover feed — no query needed |
| **byPhotoId** | photo/video IDs or URLs | those exact media records |
| **byCollection** | a collection slug or URL | every item in the collection |
| **byUser** | a photographer handle/URL | that photographer's full portfolio |
| **similarPhotos** | photo IDs or URLs | photos related to each one |

**Filters** (search mode): media type, orientation, **number of people** (none / 1 / 2), min width/height, and video duration range.

#### Example input

```json
{
  "mode": "search",
  "searchQuery": "coffee",
  "mediaType": "all",
  "orientation": "landscape",
  "maxItems": 100
}
```

#### Example output (one photo row)

```json
{
  "type": "photo",
  "id": 27860686,
  "url": "https://www.pexels.com/photo/coffee-cup-27860686/",
  "title": "coffee cup",
  "description": "A beautifully crafted cappuccino with intricate latte art…",
  "width": 2763,
  "height": 3683,
  "aspectRatio": 0.75,
  "orientation": "portrait",
  "license": "Pexels",
  "tags": ["barista", "beverage", "cappuccino", "latte art", "..."],
  "mainColor": "#918c79",
  "colors": ["#000000", "#696969", "#8b4513", "#a0522d", "#a9a9a9"],
  "photographer": "FFC Aarman",
  "photographerUrl": "https://www.pexels.com/@ffc-aarman-22995634/",
  "photographerLocation": "Jammu",
  "photographerInstagram": "ffc_aarman",
  "imageOriginal": "https://images.pexels.com/photos/27860686/pexels-photo-27860686.jpeg",
  "imageLarge": "https://images.pexels.com/photos/27860686/pexels-photo-27860686.jpeg?auto=compress&cs=tinysrgb&w=1440",
  "downloadUrl": "https://images.pexels.com/photos/27860686/pexels-photo-27860686.jpeg?cs=srgb&dl=...&fm=jpg"
}
```

Video rows add `duration`, `fps`, `videoSrc`, a `videoFiles` array (every quality with width/height/fps/link), `highestQualityUrl`, and `thumbnails`.

#### Key output fields

| Field | Description |
|---|---|
| `type` | `photo` or `video` |
| `id`, `url`, `slug` | Pexels media id, page URL, slug |
| `title`, `description`, `alt` | Text metadata |
| `width`, `height`, `aspectRatio`, `orientation` | Dimensions |
| `tags` | Content tags |
| `mainColor`, `colors` | Dominant colour + palette (hex) |
| `imageOriginal` / `imageLarge` / `imageMedium` / `imageSmall` | Photo download URLs by size |
| `videoFiles`, `videoSrc`, `highestQualityUrl` | Video renditions + best link |
| `downloadUrl` | Best single download link |
| `photographer`, `photographerUrl`, `photographerLocation`, `photographerInstagram`, `photographerTwitter` | Creator profile & socials |
| `license`, `donateUrl` | License and donation link |

#### FAQ

**Do I need a Pexels API key or account?** No. The actor is self-contained.

**Can I download the actual files?** The actor returns direct CDN URLs for every size/quality — pipe them into your own downloader or asset pipeline.

**How many results per query?** Pexels caps a single search/portfolio at roughly a few hundred results; use narrower queries (or by-collection / by-user modes) to target exactly what you need.

### 🤖 For AI Agents & LLM Apps

Compact reference for AI agents calling this actor via the [Apify MCP server](https://mcp.apify.com) or the Apify API (actor: `memo23/pexels-scraper`).

**Purpose:** Pull royalty-free Pexels photos and videos with direct CDN download URLs at every size/quality — no API key or account required.

**Minimal input:**

```json
{
  "mode": "search",
  "searchQuery": "coffee",
  "mediaType": "all",
  "maxItems": 25
}
```

ID/URL variant (no search): `{ "mode": "byCollection", "collectionSlug": "aquatic-aesthetic-bw7dkse", "maxItems": 25 }` (also `byPhotoId`/`similarPhotos` with `photoIds`, `byUser` with `username`, or `curated` with no query).

**Output:** one row per media record — type, id, url, slug, title, description, alt, width, height, aspectRatio, orientation, license, tags, mainColor, colors, imageOriginal, imageLarge, imageMedium, imageSmall, downloadUrl, photographer, photographerUrl, photographerLocation, photographerInstagram, photographerTwitter, donateUrl; video rows add duration, fps, videoSrc, videoFiles (each with width/height/fps/link), highestQualityUrl, thumbnails.

**Behaviors an agent should know:**

- Always set `maxItems` (default 30, free tier capped at 100); Pexels caps a single search/portfolio query at roughly a few hundred results.
- `mode` picks the source: `search` needs `searchQuery`; `byPhotoId`/`similarPhotos` need `photoIds`; `byCollection` needs `collectionSlug`; `byUser` needs `username`; `curated` needs nothing.
- Filters (`orientation`, `peopleCount`, `minWidth`/`minHeight`, `minDuration`/`maxDuration`) apply to `search` mode only.
- `dedupe` (default true) drops duplicate media by type + id.
- Billing: pay-per-result — one charge per media record returned; no charge for API key or login (neither is used).

#### ⚠️ Disclaimer

This actor collects publicly available media metadata and links from Pexels. All content is subject to the [Pexels License](https://www.pexels.com/license/) — please credit photographers where appropriate and use the content within Pexels' terms and applicable law. You are responsible for how you use the data.

### SEO Keywords

Pexels scraper, scrape pexels, pexels api, pexels.com scraper, Apify pexels, stock photo scraper, stock video scraper, free stock images scraper, royalty-free images download, image download url extractor, photo metadata scraper, image tags and color palette, photographer profile scraper, pexels collection scraper, bulk image download, video download links, creative assets dataset, design asset sourcing, marketing image library, no api key image scraper, royalty-free media data.

# Actor input Schema

## `mode` (type: `string`):

search = keyword search · curated = Pexels' discover feed (no query needed) · byPhotoId = look up exact photos/videos · byCollection = every item in a collection · byUser = a photographer's full portfolio · similarPhotos = photos related to the ones in Photo IDs.

## `searchQuery` (type: `string`):

Keyword to search (mode=search). Example: `nature`, `city skyline`, `coffee`.

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

Which kind of media to return. `all` returns both photos and videos (search mode).

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

Maximum number of media records to return (each is one paid `result`). Default 30. Free-tier users are capped at 100. Note: Pexels caps a single search/portfolio query at roughly a few hundred results.

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

Filter by image/video orientation.

## `peopleCount` (type: `string`):

Filter photo search results by how many people appear (mode=search, photos). `all` = no filter.

## `minWidth` (type: `integer`):

Only return media at least this wide. 0 disables.

## `minHeight` (type: `integer`):

Only return media at least this tall. 0 disables.

## `minDuration` (type: `integer`):

Only return videos at least this long (videos only). 0 disables.

## `maxDuration` (type: `integer`):

Only return videos at most this long (videos only). 0 disables.

## `photoIds` (type: `array`):

Pexels media IDs or full page URLs. For mode=byPhotoId these are looked up directly; for mode=similarPhotos each is used as a seed to find related photos. Example: `27860686` or `https://www.pexels.com/photo/.../27860686/`.

## `collectionSlug` (type: `string`):

Pexels collection slug or full collection URL (mode=byCollection). Example: `aquatic-aesthetic-bw7dkse` or a full collection URL.

## `username` (type: `string`):

Photographer handle, id, or profile URL (mode=byUser). Example: `@ffc-aarman-22995634`, `22995634`, or `https://www.pexels.com/@ffc-aarman-22995634/`.

## `dedupe` (type: `boolean`):

Drop duplicate media (same type + id). Default true.

## `secretKey` (type: `string`):

The actor ships with a working built-in key. Only set this if Pexels rotates it and the actor starts returning 0 results — paste a fresh `secret-key` value here.

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

Defaults to Apify Proxy (datacenter) for cheap IP rotation. The Pexels API needs no residential proxy.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "nature",
  "mediaType": "photos",
  "maxItems": 30,
  "orientation": "all",
  "peopleCount": "all",
  "minWidth": 0,
  "minHeight": 0,
  "minDuration": 0,
  "maxDuration": 0,
  "photoIds": [
    "27860686"
  ],
  "dedupe": true,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "mode": "search",
    "searchQuery": "nature",
    "mediaType": "photos",
    "maxItems": 30,
    "orientation": "all",
    "peopleCount": "all",
    "minWidth": 0,
    "minHeight": 0,
    "minDuration": 0,
    "maxDuration": 0,
    "photoIds": [
        "27860686"
    ],
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("memo23/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 = {
    "mode": "search",
    "searchQuery": "nature",
    "mediaType": "photos",
    "maxItems": 30,
    "orientation": "all",
    "peopleCount": "all",
    "minWidth": 0,
    "minHeight": 0,
    "minDuration": 0,
    "maxDuration": 0,
    "photoIds": ["27860686"],
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("memo23/pexels-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 '{
  "mode": "search",
  "searchQuery": "nature",
  "mediaType": "photos",
  "maxItems": 30,
  "orientation": "all",
  "peopleCount": "all",
  "minWidth": 0,
  "minHeight": 0,
  "minDuration": 0,
  "maxDuration": 0,
  "photoIds": [
    "27860686"
  ],
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call memo23/pexels-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,memo23/pexels-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/kFf7zM2aYudPOH0SK/builds/mQJiZe6grJs5gBbfI/openapi.json
