# Pexels Scraper — Free Stock Photos & Videos (`fetch_cat/pexels-scraper`) Actor

Search public Pexels photos and videos, export direct asset URLs, and keep normalized metadata without an API key.

- **URL**: https://apify.com/fetch\_cat/pexels-scraper.md
- **Developed by:** [Hanna Nosova](https://apify.com/fetch_cat) (community)
- **Categories:** Developer tools, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 item processeds

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

## Pexels Scraper — Free Stock Photos & Videos

Use this Pexels photo scraper and Pexels video scraper to search public media and export reusable metadata with direct asset URLs. No Pexels account or API key is required.

### Why use this Actor

Build a practical stock-media dataset instead of manually copying result pages. Search photos, videos, curated photos, or exact photo IDs, then export consistent rows for content planning, design research, editorial workflows, and automation.

Each row includes a canonical Pexels page, dimensions, public creator details, direct asset URLs, and request provenance. The Actor returns metadata and links; it does not download media files.

### Who is it for

- **Content teams** building a shortlist of visuals for campaigns, articles, or social posts.
- **Design and research teams** comparing public stock-media results by dimensions, orientation, and creator.
- **Developers and analysts** who need a structured Pexels dataset for an app, spreadsheet, or workflow.
- **AI and automation builders** that need direct image or video URLs as inputs to an approved downstream workflow.

### Example inputs and input recipes

#### Search photos

```json
{
  "mode": "search",
  "query": "forest",
  "mediaType": "photos",
  "maxItems": 20,
  "orientation": "landscape"
}
```

#### Search videos

```json
{
  "mode": "search",
  "query": "ocean",
  "mediaType": "videos",
  "maxItems": 20,
  "minDuration": 5
}
```

#### Fetch exact photo IDs

```json
{
  "mode": "photoId",
  "photoIds": ["12377231"],
  "maxItems": 1
}
```

#### Browse curated photos

```json
{
  "mode": "curated",
  "maxItems": 20,
  "orientation": "portrait"
}
```

### Input settings

| Key | Use |
| --- | --- |
| `mode` | Choose `search`, `curated`, or `photoId`. |
| `query` | Search phrase used in `search` mode. |
| `mediaType` | Choose `photos`, `videos`, or `all` for search. |
| `photoIds` | Pexels photo IDs or photo URLs for exact lookup. |
| `maxItems` | Maximum unique rows to save, from 1 to 100. |
| `orientation` | Keep `landscape`, `portrait`, `square`, or `all`. |
| `minWidth`, `minHeight` | Exclude smaller media with local dimension filters. |
| `minDuration`, `maxDuration` | Keep videos within a duration range in seconds. |
| `dedupe` | Keep one row per media type and Pexels ID. |

### What data you get

| Field | Meaning |
| --- | --- |
| `recordType`, `id`, `pageUrl` | Media type, Pexels ID, and canonical page. |
| `title`, `alt`, `tags`, `license` | Public descriptive metadata and license label. |
| `width`, `height`, `aspectRatio`, `orientation` | Media dimensions and normalized orientation. |
| `avgColor` | Source-provided average color when available. |
| `photographerId`, `photographerName`, `photographerUrl` | Public creator identity and profile link. |
| `imageOriginalUrl`, `imageLargeUrl`, `imageMediumUrl`, `imageSmallUrl` | Photo rendition URLs for photo rows. |
| `downloadUrl` | Best available direct asset URL for the media. |
| `durationSeconds`, `fps`, `videoFiles`, `bestVideoUrl` | Video metadata and files for video rows. |
| `sourceMode`, `sourceQuery`, `sourcePage`, `sourceApiUrl`, `scrapedAt` | Public-source request context. |

Photo-only and video-only fields are `null` or empty arrays when they do not apply. This is intentional: the Actor does not infer missing media attributes.

### Example output

```json
{
  "recordType": "photo",
  "id": "12377231",
  "pageUrl": "https://www.pexels.com/photo/12377231/",
  "width": 4000,
  "height": 2667,
  "orientation": "landscape",
  "photographerName": "Example creator",
  "downloadUrl": "https://images.pexels.com/photos/example.jpeg",
  "sourceMode": "search",
  "sourceQuery": "forest"
}
```

### Pricing and limits

This Actor charges a small run-start fee and a per-saved-media-record fee. Prices vary by Apify subscription tier; see the [live Pricing tab](https://apify.com/fetch_cat/pexels-scraper/pricing) for current rates.

A run can save up to 100 unique media records. Public Pexels availability, the chosen query, and filters determine the number of matching rows.

### API usage

Use the Actor from the Apify Console, API, SDK, MCP, or an automation platform. The completed default dataset can be exported to JSON, CSV, Excel, Google Sheets, or a downstream workflow.

#### Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/pexels-scraper').call({
  mode: 'search', query: 'forest', mediaType: 'photos', maxItems: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("fetch_cat/pexels-scraper").call(run_input={
    "mode": "search", "query": "forest", "mediaType": "photos", "maxItems": 20,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/fetch_cat~pexels-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"search","query":"forest","mediaType":"photos","maxItems":20}'
```

### MCP and automation

Add this Actor to your Apify MCP tools with [mcp.apify.com/?tools=fetch\_cat/pexels-scraper](https://mcp.apify.com/?tools=fetch_cat/pexels-scraper). For Claude Code, add the server with:

```bash
claude mcp add apify -- npx -y @apify/mcp-server --tools fetch_cat/pexels-scraper
```

Or add an MCP server configuration:

```json
{"mcpServers":{"apify":{"command":"npx","args":["-y","@apify/mcp-server","--tools","fetch_cat/pexels-scraper"]}}}
```

Example prompts: “Search Pexels for 20 landscape forest photos” or “Export ten ocean video records with direct URLs.” For no-code workflows, run it through Apify integrations and pass the resulting dataset to your preferred destination.

### Tips for better results

- Start with a specific visual phrase such as `aerial forest` or `ocean waves`.
- Use `mediaType: "all"` when a single dataset can include both photos and videos.
- Use `orientation` and minimum dimensions to avoid a later filtering step.
- Use exact IDs when you need stable lookups for known Pexels photos.
- Keep `dedupe` enabled when combining result types or repeated searches.

### Limitations

The Actor uses public data only. It does not accept cookies, Pexels credentials, or API keys. Collection pages, photographer portfolios, similar-media lookup, account-only data, EXIF details, reactions, and media-file downloading are not supported in this release.

Respect Pexels terms and the rights applicable to each asset before using a result in your own project. Direct URLs may change or become unavailable on the source site.

### FAQ

#### Does it download media files?

No. It exports public metadata and direct asset URLs.

#### Can I use a Pexels API key or cookies?

No. This Actor does not require or accept keys, accounts, or cookies.

#### Why are some fields empty?

Photo and video records have different applicable fields. The Actor returns `null` or an empty array rather than guessing.

#### Can I collect collections or creator portfolios?

Not in this release. The supported modes are search, curated photos, and exact-photo lookup.

#### Can I use this with an AI agent?

Yes. Connect the Actor through the [Apify MCP tool](https://mcp.apify.com/?tools=fetch_cat/pexels-scraper) or call it with the API examples above, then pass only the exported dataset fields your workflow needs.

#### Where can I get help?

Open the Actor's Issues tab with a redacted input and run ID. Include the mode, query, and expected record type so support can reproduce the request.

### Related Actors

- [Google Images Scraper](https://apify.com/fetch_cat/google-images-scraper)
- [Google Search Results Scraper](https://apify.com/fetch_cat/google-search-results-scraper)
- [Amazon Products Search Scraper](https://apify.com/fetch_cat/amazon-products-search-scraper)
- [TikTok Sound Scraper](https://apify.com/fetch_cat/tiktok-sound-scraper)
- [PDF Text & Markdown Extractor](https://apify.com/fetch_cat/pdf-text-markdown-extractor)

### Support

Need help with an input or exported dataset? Contact support through the Actor's Issues tab with a redacted input and run ID.

# Actor input Schema

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

Choose the public Pexels source.

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

Keyword used when mode is Search.

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

Choose photos, videos, or both for Search mode.

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

Exact Pexels photo IDs used in Exact photo IDs mode.

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

Maximum unique records to save (1–100).

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

Keep only landscape, portrait, square, or all media.

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

Exclude narrower media; zero disables this filter.

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

Exclude shorter media; zero disables this filter.

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

Exclude shorter videos; zero disables this filter.

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

Exclude longer videos; zero disables this filter.

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

Keep only one row per media type and Pexels ID.

## Actor input object example

```json
{
  "mode": "search",
  "query": "nature",
  "mediaType": "photos",
  "photoIds": [
    "12377231"
  ],
  "maxItems": 20,
  "orientation": "all",
  "minWidth": 0,
  "minHeight": 0,
  "minDuration": 0,
  "maxDuration": 0,
  "dedupe": true
}
```

# 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 = {
    "mode": "search",
    "query": "nature",
    "mediaType": "photos",
    "photoIds": [
        "12377231"
    ],
    "maxItems": 20,
    "orientation": "all",
    "minWidth": 0,
    "minHeight": 0,
    "minDuration": 0,
    "maxDuration": 0,
    "dedupe": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/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",
    "query": "nature",
    "mediaType": "photos",
    "photoIds": ["12377231"],
    "maxItems": 20,
    "orientation": "all",
    "minWidth": 0,
    "minHeight": 0,
    "minDuration": 0,
    "maxDuration": 0,
    "dedupe": True,
}

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/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",
  "query": "nature",
  "mediaType": "photos",
  "photoIds": [
    "12377231"
  ],
  "maxItems": 20,
  "orientation": "all",
  "minWidth": 0,
  "minHeight": 0,
  "minDuration": 0,
  "maxDuration": 0,
  "dedupe": true
}' |
apify call fetch_cat/pexels-scraper --silent --output-dataset

```

## MCP server setup

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