Pexels Scraper — Free Stock Photos & Videos

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

Data fields

FieldTypeDescription
recordTypestringValue exported as recordType.
idintegerValue exported as id.
pageUrlstringValue exported as pageUrl.
titlestring | nullValue exported as title.
altstring | nullValue exported as alt.
widthintegerValue exported as width.
heightintegerValue exported as height.
aspectRationumberValue exported as aspectRatio.

Input preview

modeMode *
querySearch query
mediaTypeMedia type
photoIdsPhoto IDs or Pexels photo URLs
maxItemsMaximum media records
orientationOrientation

API and agents

This actor can be run through Apify API, datasets, webhooks, schedules, and the official Apify MCP server.

Ready-to-run examples

Open a saved Apify example, adjust the input, and run the actor in your own Apify account.

View all examples

How this actor works

See example inputs, outputs, API usage, and practical limits before running this actor on Apify.

Open Apify page

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

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

Search videos

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

Fetch exact photo IDs

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

Browse curated photos

{
  "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

{
  "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"
}

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

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

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

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. For Claude Code, add the server with:

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

Or add an MCP server configuration:

{"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.

Support

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

Common questions

Questions and answers reused from the canonical actor README.

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 or call it with the API examples above, then pass only the exported dataset fields your workflow needs.